SESSION NAME: Sub Queries.

QUESTION NAME: Sub Query - 3.


TABLE DESCRIPTION:

Write a query to display the name ( first name and last
name ), salary, department id for those employees who 
earn such amount of salary which is the smallest salary
of any of the departments.

Table name = sub_employees
Use Sub Queries

CODE:

SELECT first_name, last_name, salary, department_id   FROM sub_employees   WHERE salary IN   ( SELECT MIN(salary)  FROM sub_employees   GROUP BY department_id );