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.

Oracle 12c: SQL
3rd Edition
ISBN:9781305251038
Author:Joan Casteel
Publisher:Joan Casteel
Chapter6: Additional Database Objects
Section: Chapter Questions
Problem 11HOA
icon
Related questions
Question
100%

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. 

 

 

Table Name: employees
Attribute Name
employee_id
first_name
last_name
email
phone_number
hire_date
job_id
salary
commission_pct
manager_id
department_id
Attribute type
char(10)
varchar(20)
varchar(20)
varchar(60)
char(14)
date
char(10)
int
decimal(5,3)
char(10)
char(10)
Transcribed Image Text:Table Name: employees Attribute Name employee_id first_name last_name email phone_number hire_date job_id salary commission_pct manager_id department_id Attribute type char(10) varchar(20) varchar(20) varchar(60) char(14) date char(10) int decimal(5,3) char(10) char(10)
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Elements of Tables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage