SESSION NAME: Sub Queries.

QUESTION NAME: Sub Query - 5.


TABLE DESCRIPTION:

Write a query to display the employee name ( first name
and last name ), employee id and salary of all employees
who report to Payam

Table name = sub_employees
Use Sub Queries

CODE:

SELECT first_name, last_name, employee_id, salary   FROM sub_employees   WHERE manager_id =  (SELECT employee_id   FROM sub_employees   WHERE first_name = 'Payam'  );