Proving yourself worthy of being able to handle bigger tasks, the tech lead has decided to give you a challenging job. However, this time, the data that you would be handling is very sensitive and no one wants this data to be leaked. Therefore, instead of getting the entire table, the tech lead has given you the list of attributes that the table contains and the table name. The information given is as follows: You are tasked with building the MySql queries to retrieve the following information: 1. Find the first_name, last_name, email, phone_number, hire_date, and department_id of all the employees with the latest hire_date. 2. Find the first_name, last_name, employee_id, phone_number, salary and department_id of all the employees with the lowest salary in each department. 3. Find the first_name, last_name, employee_id, commission_pct and department_id of all the employees in the department 'DPT007' who have a lower commission_pct than all of the employees of the department 'DPT005'. 4. Find the department_id and total number of employees of each department which does not have a single employee under it with a salary more than 30,000.
Proving yourself worthy of being able to handle bigger tasks, the tech lead has decided to give you a challenging job. However, this time, the data that you would be handling is very sensitive and no one wants this data to be leaked. Therefore, instead of getting the entire table, the tech lead has given you the list of attributes that the table contains and the table name. The information given is as follows:
You are tasked with building the MySql queries to retrieve the following information:
1. Find the first_name, last_name, email, phone_number, hire_date, and department_id of all the employees with the latest hire_date.
2. Find the first_name, last_name, employee_id, phone_number, salary and department_id of all the employees with the lowest salary in each department.
3. Find the first_name, last_name, employee_id, commission_pct and department_id of all the employees in the department 'DPT007' who have a lower commission_pct than all of the employees of the department 'DPT005'.
4. Find the department_id and total number of employees of each department which does not have a single employee under it with a salary more than 30,000.
Step by step
Solved in 8 steps with 8 images