Ch 1 · Reading Data · SQL
Topic 1 of 8 in SQL — Query a Real Database — 2 lessons.
SELECT
SQL reads data from tables. SELECT chooses columns, FROM names the table. Click ▶ Run Query to run it against a real database in your browser.
WHERE
WHERE filters rows by a condition. Text goes in single quotes; numbers compare directly. Combine with AND / OR. Look at the example: it keeps only the rows where dept_id equals 1 (the Engineering department), and shows just the first_name, last_name and salary columns. WHERE is how you ask a precise question of a big table, so most real queries use one. Try changing the number to see other departments.