1. Structured Query Language (SQL)

  • Databases can be searched for specific data. The search process for searching databases utilises a query language. Some DBMS use their own query languages, or query by example.
  • Experienced users tend to prefer to use Structured Query Language (SQL). SQL is a non-proprietary language which enables users to execute queries across a number of tables.
  • The Four key words in SQL are
    • SELECT
    • FROM
    • WHERE
    • ORDER BY

SELECT: - this enables the user to select the attributes or fields which will be used in the query eg. Surname.Student_Details
FROM: - this enables the user to select the entity from which the attributes are retrieved. eg. Student_Details, Classes
WHERE: - the condition on which the data will be sorted eg. Class_id="12IPT"
ORDER BY: Surname.Student_Details ASC

When conducting a SQL query, the user will most often use either Relational or Logical operators, or a combination of both.
These include:

Relational Operators
TERM
SQL
EQUALS
=
NOT EQUAL TO
<> 
GREATER THAN

GREATER THAN, EQUAL TO
>=
LESS THAN

LESS THAN, EQUAL TO
<=
 CONTAINS   LIKE
 DOES NOT CONTAIN NOT LIKE

Logical Operators

AND - when both expresssions are TRUE
OR - When ONE expression is TRUE
NOT - Opposite expression


Pre-class video - SQL Basics

SQL part 1.mp4


Pre-class video - SQL Basics +

SQL part 2.mp4






For a more comprehensive tutorial on how to create as well as retrieve data....

SQL for Beginners. Learn basics of SQL in 1 Hour



Online Tutorial for SQL
The following website is a very useful hands-on/practical examples for ISO/Standard SQL.  It contains sample databases and an ability to try out SQL statements:


Hour Of Code - Learn Databases