Congrats on finishing the first chapter! You now know how to select columns and perform basic counts. This chapter will focus on filtering your results.
In SQL, the
WHERE keyword allows you to filter based on both text and numeric values in a table. There are a few different comparison operators you can use:
<=less than or equal to
>=greater than or equal to
For example, you can filter text records such as
title. The following code returns all films with the title
SELECT title FROM films WHERE title = 'Metropolis';
Notice that the
WHERE clause always comes after the
Note that in this course we will use
<> and not
!= for the not equal operator, as per the SQL standard.
SELECT title FROM films WHERE release_year > 2000;