One Pager Cheat Sheet
- This tutorial introduces the
WHERE
keyword and other important keywords, LIKE, IN, BETWEEN, AND, OR, and NOT, to help filter data efficiently in SQL queries utilizing the Person table. - The LIKE operator is used to find specific patterns in the columns, using
percent
andunderscore
signs as wildcards. - The
LIKE
operator with%
wildcard is used to retrieve all rows from the Person table where the Name column ends with "a". - The AND operator can be used to
filter
data byspecifying multiple conditions
in aSQL query
, for example to get all customers living in the USA which are male. - The OR operator can be used in
SQL
to filter records that match at least one of multiple conditions. - The
IN statement
allows us to find the values that belong to a specified set, and is a shorthand for multipleOR
statements. - The
NOT IN
operator allows us to return all rows not satisfying a given condition. - By combining the
AND
,OR
, andNOT
keywords through the use of parentheses, it is possible to create complex conditional logic in a single query. - The
BETWEEN
operator is used to filter out rows between two specified values (inclusive) from a table.