>_ IzzyLab

Topic breakdown

WHERE keeps only the rows for which the condition is true. The condition goes after FROM table:

SELECT title FROM books WHERE year = 1999;   -- books from exactly 1999
SELECT title FROM books WHERE year < 1950;   -- published before 1950
SELECT title FROM books WHERE author = 'Tolkien';

Comparisons: = (equals — a single sign, not two), <> or != (not equal), <, >, <=, >=. Numbers are written as is, and text goes in single quotes.

SELECT and WHERE work independently: in WHERE you can check a column you don't print.

What's checked

  1. File /root/sold_out.txt created
  2. The file holds only names, no numbers
  3. The file lists exactly the products that are out of stock

What it looks like