Q. How would you select all employees from the ‘Employees’ table who are in the ‘Sales’ department OR the ‘Marketing’ department?

A
WHERE department = 'Sales' AND department = 'Marketing'
B
WHERE department IN ('Sales', 'Marketing')
C
WHERE department = 'Sales' OR 'Marketing'
D
WHERE department = 'Sales' & 'Marketing'
Solution:

The IN operator is a shorthand for multiple OR conditions. It checks if a value matches any value in a list. Option A is logically impossible (a department cannot be both ‘Sales’ and ‘Marketing’ at the same time).

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!