Complete the code to select rows where age is greater than 18 and status is 'active'.
SELECT * FROM users WHERE age > 18 [1] status = 'active';
The AND operator ensures both conditions must be true for a row to be selected.
Complete the code to select rows where city is 'New York' or city is 'Los Angeles'.
SELECT * FROM customers WHERE city = 'New York' [1] city = 'Los Angeles';
The OR operator selects rows where either condition is true.
Fix the error in the code to select rows where NOT status is 'inactive'.
SELECT * FROM accounts WHERE [1] status = 'inactive';
The NOT operator negates the condition, selecting rows where status is not 'inactive'.
Fill both blanks to select rows where age is greater than 30 and city is not 'Chicago'.
SELECT * FROM employees WHERE age > 30 [1] [2] city = 'Chicago';
Use AND to combine conditions and NOT to negate the city condition.
Fill all three blanks to select rows where (salary > 50000 or position is 'Manager') and department is not 'Sales'.
SELECT * FROM staff WHERE (salary > 50000 [1] position = 'Manager') [2] [3] department = 'Sales';
Use OR inside parentheses to select salary or position, then AND to combine with the negated department condition using NOT.