In a table with lots of rows, we will probably want to restrict the number of rows that we retrieve. We can do this using one or more WHERE
clauses. When filtering, we can use either full and exact column values or partial values.
When filtering by exact values, we use the full value of a column. For example, a WHERE
clause to retrieve data about everyone born on or after January 1, 1970 is given as follows:
WHERE birthday >= '1970-01-01'
The output will look similar to the following:
MariaDB [test]> SELECT * FROM employees -> WHERE birthday >= '1970-01-01'; +----+----------------+---------------+-----------+------------+ | id | surname | givenname | pref_name | birthday | +----+----------------+---------------+-----------+------------+ | 1 | Perry | Lowell Tom | Tom | 1988-08-05 | | 2 | Pratt | Parley | NULL | 1975-04-12 | | 7 | Smith | George Albert...