Mysql column subquery
# case: returns all employees in a department whose location_id is 1400 or 1700
SELECT last_nameFROM employees WHERE department_id IN (SELECT DISTINCT department_id FROM departments WHERE location_id IN (1400, 1700))
# case: returns the employee number, name, job_id and salary of employees in other jobs who are paid less than any of the employees in the job_id 'IT_PROG' department
SELECT DISTINCT employee_id,last_name,job_id,salaryFROM employeesWHERE salary