Indicates which columns to return
Select
Indicates which table to query
From
The rules that determine what is correctly structured in a computing language
Syntax
Select all
Semi;colon
When you end a query
Sequence the records returned by a query based on specified columns or column
ORDER BY
Order by descending order
ORDER BY xxx DESC
Ordering multiple columns
ORDER BY xxx, zzz;
The condition for the Filter
WHERE
Wildcard a special character that can be substituted with any other character
% substitutes for any number of other characters
or
_ substitutes for one character
Wildcard possible patterns
‘a%’ = apple, art, a
‘a_’ = as, an, a7
‘a__’ = ant, add, a1c
‘%a’ = pizza, Z6ra, a
‘_a’ = ma, 1a, Ha
‘%a%’ = Again, back, a
‘a’ = Car, ban, ea7
Apply wildcards to a filter
LIKE
An operator that filters for numbers or dates within range
BETWEEN
Comparison Operators
< less than
> greater than
= equal to
<= less than or equal to
>= greater than or equal to
<> not equal to
Specifies that both conditions must be met simultaneously
AND
Specifies that either condition can be met
Or
Negates a condition
Not
Joining tables
Employees.employees_id (example)
Returns rows matching on a specified column that exists in more than one table
Inner join
3 types of outer joins
Left Join
Right Join
Full outer join
Returns all of the records of the first table but only returns rows of the second table that match on a specified column
Left join
Returns all of the records of the second table, but only returns rows from the first table that match on a specified column
Right join
Returns all records from both tables
Full outer join
Returns a single number that represents the number of rows returned from your query
Count