Proficient programming requires knowledge of many techniques. These techniques allow for powerful, complex programs.
Part ofComputer ScienceComputational thinking, algorithms and programming
Databases use their own type of programming language. This language is known as structured query language, or SQL.
Consider this simple personnel table with four records:
Data can be retrieved using the commandsclosecommandAn instruction given to a computer.SELECT, FROM and WHERE
SELECT, FROM
WHERE
SELECT * FROM "personnel" WHERE "Title" = "Mr"
Note - * stands for wildcard, which means all records. This would retrieve the following data:
*
1001 Mr Alan Turing [email protected]
1004 Mr George Boole [email protected]
The LIKE command can be used to find matches for an incomplete word, for example:
LIKE
SELECT * FROM "personnel" WHERE "email address" LIKE "%com"
This would retrieve:
1002 Mrs Ada Lovelace [email protected]
Note - %com is also a wildcard which will return any value that contains “com”.
%com
BooleancloseBooleanA data type in computing which only has two possible values, true or false. operators AND and OR can also be used to retrieve data.
AND
OR
SELECT * FROM "personnel" WHERE "Surname" = "Turing" OR "Hopper"
1003 Miss Grace Hopper [email protected]