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: a) 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. b) For each of the departments, find the department_id, job_id and commission_pct with commission_pct less than at least one other job_id in that department. c) Find the manager_id who does not have any employee under them with a salary less than 3500. d) Find the first_name, last_name, employee_id, email, salary, department_id and commission_pct of the employee who has the lowest commission_pct under each manager.
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:
a) 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.
b) For each of the departments, find the department_id, job_id and commission_pct with commission_pct less than at least one other job_id in that department.
c) Find the manager_id who does not have any employee under them with a salary less than 3500.
d) Find the first_name, last_name, employee_id, email, salary, department_id and commission_pct of the employee who has the lowest commission_pct under each manager.
Step by step
Solved in 2 steps