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.

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

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.

 

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 8 steps with 8 images

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