Complete the code to select rows where age is greater than 30 and city is 'New York'.
SELECT * FROM users WHERE age [1] 30 AND city = 'New York';
The operator '>' means greater than, so age > 30 selects users older than 30.
Complete the code to select rows where status is 'active' or last_login is before 2023-01-01.
SELECT * FROM accounts WHERE status = 'active' OR last_login [1] '2023-01-01';
The operator '<' means before in dates, so last_login < '2023-01-01' selects older logins.
Fix the error in the WHERE clause to correctly select rows where score is greater than 80 and grade is 'A' or 'B'.
SELECT * FROM results WHERE score [1] 80 AND (grade = 'A' OR grade = 'B');
The operator '>' selects scores greater than 80. This is needed to filter high scores.
Fill both blanks to select rows where salary is greater than 50000 and department is 'Sales' or 'Marketing'.
SELECT * FROM employees WHERE salary [1] 50000 AND (department [2] 'Sales' OR department = 'Marketing');
Salary greater than 50000 uses '>'. Department equals 'Sales' uses '='.
Fill all three blanks to select rows where age is less than 40, city is 'Chicago', and status is not 'inactive'.
SELECT * FROM users WHERE age [1] 40 AND city [2] 'Chicago' AND status [3] 'inactive';
Age less than 40 uses '<'. City equals 'Chicago' uses '='. Status not equal to 'inactive' uses '!='.