SQL Flashcards
vertical bar | meaning
bar meaning
OR
curly brackets {…} meaning
indicates a required element
square bracket […] meaning
indicate an optional element or optional repetition
SELECT description
selects specific columns
FROM description
specifies the table(s)
WHERE description
filters individual rows that are subject to some condition
GROUP BY description
groups together rows with same column name
HAVING description
filters groups that are subject to some condition
ORDER BY description
specifies the order of the output
SELECT everything query
SELECT (*) FROM table;
IS NULL description
to test for empty values
IS NOT NULL description
to test for non-empty values
SELECT DISTINCT description
selects columns without the repetitive values
AS description
renames a column
LIKE description
to search for a specified pattern
% meaning
0 or more characters
_ meaning
any single character
e.g S% meaning
any string starting with the letter “S”