Complete the code to select all records where the age is greater than 30.
SELECT * FROM employees WHERE age [1] 30;
The WHERE clause filters rows where the age is greater than 30, so the correct operator is >.
Complete the code to select employees whose department is 'Sales'.
SELECT * FROM employees WHERE department [1] 'Sales';
The WHERE clause checks for equality with the string 'Sales', so the correct operator is '='.
Fix the error in the code to select employees hired before 2020.
SELECT * FROM employees WHERE hire_date [1] '2020-01-01';
To select employees hired before 2020, the hire_date must be less than '2020-01-01', so the operator is <.
Fill both blanks to select employees with salary greater than 50000 and department 'HR'.
SELECT * FROM employees WHERE salary [1] 50000 [2] department = 'HR';
The salary must be greater than 50000, so use >. Both conditions must be true, so use AND.
Fill all three blanks to select employees where age is less than 40, department is 'IT', and salary is at least 60000.
SELECT * FROM employees WHERE age [1] 40 [2] department [3] 'IT' AND salary >= 60000;
Age less than 40 uses <. The department condition is combined with AND. The department must equal 'IT', so use =.