SlideShare a Scribd company logo
1 of 19
SQL CASE STUDY 2
- BY RADHIKA KASHID
1. Write a SQL query to find those employees whose salary
is higher than 9000. Return first name, last name and
department number and salary.
2.Write a SQL query to identify employees who do not
have a department number. Return employee_id,
first_name, last_name, email, phone_number, hire_date,
job_id, salary,commission_pct, manager_id and
department_id
3. Write a SQL query to find those employees whose first name
does not contain the letter ‘T’. Sort the result-set in ascending order
by department ID. Return full name (first and last name together),
hire_date, salary and department_id.
4. Write a SQL query to find those employees who earn
between 9000 and 12000 (Begin and end values are included.)
and get some commission. Return all fields
5. Write a SQL query to find those employees who do not earn
any commission. Return full name (first and last name), and
salary.
6. Write a SQL query to find those employees who work under
a manager. Return full name (first and last name), salary, and
manager ID.
7. Write a SQL query to find employees whose first names
contain the letters F, T, or M. Sort the result-set in descending
order by salary. Return all fields
8. Write a SQL query to find those employees who earn above 12000 or
the seventh character in their phone number is 3. Sort the result-set in
descending order by first name. Return full name (first name and last
name), hire date, commission percentage, email, and telephone separated
by '-', and salary.
9. Write a SQL query to find those employees whose first name contains a
character 's' in the third position. Return first name, last name and
department id.
10. Write a SQL query to find those employees who worked more than
two jobs in the past. Return employee id. 11. Write a SQL query to count the number of employees, the sum of all
salary, and difference between the highest salary and lowest salaries by
each job id. Return job_id, count, sum, salary_difference.
12. Write a SQL query to find each job ids where two or more employees
worked for more than 300 days. Return job id. 13. Write a SQL query to count the number of employees worked under
each manager. Return manager ID and number of employees
14. Write a SQL query to calculate the average salary of employees who receive a commission percentage for each department. Return department id,
average salary
15. Write a SQL query to find the departments where more than ten
employees receive commissions. Return department id
16. Write a SQL query to find those job titles where maximum salary falls
between 10000 and 15000 (Begin and end values are included.). Return
job_title, max_salarymin_salary.
17. Write a SQL query to find details of those jobs where the minimum
salary exceeds 9000. Return all the fields of jobs
18. Write a SQL query to find those employees who work in the same
department as ‘Clara’. Exclude all those records where first name is ‘Clara’.
Return first name, last name and hire date.
19. Write a SQL query to find those employees who earn more than the
average salary and work in the same department as an employee whose
first name contains the letter ‘J’ at third position. Return employee ID, first
name and salary
20. Write a query to display the employee id, name ( first name and last
name ) and the job id column with a modified title SALESMAN for those
employees whose job title is ST_MAN and DEVELOPER for whose job title
is IT_PROG.
JOINS QUETIONS
1. Write a SQL query to find the first name, last name, department, city,
and state province for each employee.
2. Write a SQL query to find the first name, last name, salary, and job
grade for all employees
3. Write a SQL query to find all those employees who work in department
ID 80 or 40. Return first name, last name, department number and
department name
4. Write a SQL query to find those employees whose first name contains
the letter ‘z’. Return first name, last name, department, city, and state
province
5. Write a SQL query to find all employees who joined on 1st January
1993 and left on or before 31 August 2005. Return job title, department
name, employee name, and joining date of the job.
6. Write a SQL query to calculate the difference between the maximum
salary of the job and the employee's salary. Return job title, employee
name, and salary difference
7. Write a SQL query to find the department name and the full name (first
and last name) of the manager
8. Write a SQL query to find the department name, full name (first and last
name) of the manager and their city
9. Write a SQL query to find out the full name (first and last name) of the
employee with an ID and the name of the country where he/she is
currently employed.
THANK YOU!!!!

More Related Content

Similar to SQL case study Analysis PPT by Radhika Kashidd

Plsql task answers
Plsql task answersPlsql task answers
Plsql task answersNawaz Sk
 
SQL practice questions - set 3
SQL practice questions - set 3SQL practice questions - set 3
SQL practice questions - set 3Mohd Tousif
 
DBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR SchemaDBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR SchemaMohammad Imam Hossain
 
Rdbms class test ii sep 2019
Rdbms class test  ii sep 2019Rdbms class test  ii sep 2019
Rdbms class test ii sep 2019ARVIND SARDAR
 
SQL Practice Question set
SQL Practice Question set SQL Practice Question set
SQL Practice Question set Mohd Tousif
 
Nikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd YearNikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd Yeardezyneecole
 
Plsql task
Plsql taskPlsql task
Plsql taskNawaz Sk
 
Divyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole College
Divyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole CollegeDivyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole College
Divyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole Collegedezyneecole
 
Module 3.1.pptx
Module 3.1.pptxModule 3.1.pptx
Module 3.1.pptxANSHVAJPAI
 
Simran kaur,BCA Final Year 2015
Simran kaur,BCA Final Year 2015Simran kaur,BCA Final Year 2015
Simran kaur,BCA Final Year 2015dezyneecole
 
Add a new check on the emp table to make sure that any new employee in.docx
Add a new check on the emp table to make sure that any new employee in.docxAdd a new check on the emp table to make sure that any new employee in.docx
Add a new check on the emp table to make sure that any new employee in.docxwviola
 
AimTo give you practical experience in database modelling, no.docx
AimTo give you practical experience in database modelling, no.docxAimTo give you practical experience in database modelling, no.docx
AimTo give you practical experience in database modelling, no.docxsimonlbentley59018
 
Apurv Gupta, BCA ,Final year , Dezyne E'cole College
 Apurv Gupta, BCA ,Final year , Dezyne E'cole College Apurv Gupta, BCA ,Final year , Dezyne E'cole College
Apurv Gupta, BCA ,Final year , Dezyne E'cole Collegedezyneecole
 
SQL commands.docx
SQL commands.docxSQL commands.docx
SQL commands.docxAnupJoshi46
 

Similar to SQL case study Analysis PPT by Radhika Kashidd (20)

Plsql task answers
Plsql task answersPlsql task answers
Plsql task answers
 
SQL practice questions - set 3
SQL practice questions - set 3SQL practice questions - set 3
SQL practice questions - set 3
 
DBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR SchemaDBMS 5 | MySQL Practice List - HR Schema
DBMS 5 | MySQL Practice List - HR Schema
 
Oracle examples
Oracle examplesOracle examples
Oracle examples
 
Rdbms class test ii sep 2019
Rdbms class test  ii sep 2019Rdbms class test  ii sep 2019
Rdbms class test ii sep 2019
 
SQL Practice Question set
SQL Practice Question set SQL Practice Question set
SQL Practice Question set
 
newsql
newsqlnewsql
newsql
 
Access practicals 2015
Access practicals 2015Access practicals 2015
Access practicals 2015
 
Nikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd YearNikhil Khandelwal BCA 3rd Year
Nikhil Khandelwal BCA 3rd Year
 
Plsql task
Plsql taskPlsql task
Plsql task
 
Dbms record
Dbms recordDbms record
Dbms record
 
Divyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole College
Divyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole CollegeDivyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole College
Divyansh Mehta,BCA Final Year 2015 ,Dezyne E'cole College
 
Module 3.1.pptx
Module 3.1.pptxModule 3.1.pptx
Module 3.1.pptx
 
Simran kaur,BCA Final Year 2015
Simran kaur,BCA Final Year 2015Simran kaur,BCA Final Year 2015
Simran kaur,BCA Final Year 2015
 
Add a new check on the emp table to make sure that any new employee in.docx
Add a new check on the emp table to make sure that any new employee in.docxAdd a new check on the emp table to make sure that any new employee in.docx
Add a new check on the emp table to make sure that any new employee in.docx
 
Ravi querys 425
Ravi querys  425Ravi querys  425
Ravi querys 425
 
AimTo give you practical experience in database modelling, no.docx
AimTo give you practical experience in database modelling, no.docxAimTo give you practical experience in database modelling, no.docx
AimTo give you practical experience in database modelling, no.docx
 
Apurv Gupta, BCA ,Final year , Dezyne E'cole College
 Apurv Gupta, BCA ,Final year , Dezyne E'cole College Apurv Gupta, BCA ,Final year , Dezyne E'cole College
Apurv Gupta, BCA ,Final year , Dezyne E'cole College
 
75864 sql
75864 sql75864 sql
75864 sql
 
SQL commands.docx
SQL commands.docxSQL commands.docx
SQL commands.docx
 

Recently uploaded

8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital ManagementMBA Assignment Experts
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaEADTU
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesPooky Knightsmith
 
Book Review of Run For Your Life Powerpoint
Book Review of Run For Your Life PowerpointBook Review of Run For Your Life Powerpoint
Book Review of Run For Your Life Powerpoint23600690
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project researchCaitlinCummins3
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi RajagopalEADTU
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxneillewis46
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxMarlene Maheu
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSean M. Fox
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFVivekanand Anglo Vedic Academy
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...Nguyen Thanh Tu Collection
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhleson0603
 

Recently uploaded (20)

Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
Book Review of Run For Your Life Powerpoint
Book Review of Run For Your Life PowerpointBook Review of Run For Your Life Powerpoint
Book Review of Run For Your Life Powerpoint
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 

SQL case study Analysis PPT by Radhika Kashidd

  • 1. SQL CASE STUDY 2 - BY RADHIKA KASHID
  • 2. 1. Write a SQL query to find those employees whose salary is higher than 9000. Return first name, last name and department number and salary. 2.Write a SQL query to identify employees who do not have a department number. Return employee_id, first_name, last_name, email, phone_number, hire_date, job_id, salary,commission_pct, manager_id and department_id
  • 3. 3. Write a SQL query to find those employees whose first name does not contain the letter ‘T’. Sort the result-set in ascending order by department ID. Return full name (first and last name together), hire_date, salary and department_id.
  • 4. 4. Write a SQL query to find those employees who earn between 9000 and 12000 (Begin and end values are included.) and get some commission. Return all fields 5. Write a SQL query to find those employees who do not earn any commission. Return full name (first and last name), and salary.
  • 5. 6. Write a SQL query to find those employees who work under a manager. Return full name (first and last name), salary, and manager ID. 7. Write a SQL query to find employees whose first names contain the letters F, T, or M. Sort the result-set in descending order by salary. Return all fields
  • 6. 8. Write a SQL query to find those employees who earn above 12000 or the seventh character in their phone number is 3. Sort the result-set in descending order by first name. Return full name (first name and last name), hire date, commission percentage, email, and telephone separated by '-', and salary. 9. Write a SQL query to find those employees whose first name contains a character 's' in the third position. Return first name, last name and department id.
  • 7. 10. Write a SQL query to find those employees who worked more than two jobs in the past. Return employee id. 11. Write a SQL query to count the number of employees, the sum of all salary, and difference between the highest salary and lowest salaries by each job id. Return job_id, count, sum, salary_difference.
  • 8. 12. Write a SQL query to find each job ids where two or more employees worked for more than 300 days. Return job id. 13. Write a SQL query to count the number of employees worked under each manager. Return manager ID and number of employees
  • 9. 14. Write a SQL query to calculate the average salary of employees who receive a commission percentage for each department. Return department id, average salary
  • 10. 15. Write a SQL query to find the departments where more than ten employees receive commissions. Return department id 16. Write a SQL query to find those job titles where maximum salary falls between 10000 and 15000 (Begin and end values are included.). Return job_title, max_salarymin_salary.
  • 11. 17. Write a SQL query to find details of those jobs where the minimum salary exceeds 9000. Return all the fields of jobs 18. Write a SQL query to find those employees who work in the same department as ‘Clara’. Exclude all those records where first name is ‘Clara’. Return first name, last name and hire date.
  • 12. 19. Write a SQL query to find those employees who earn more than the average salary and work in the same department as an employee whose first name contains the letter ‘J’ at third position. Return employee ID, first name and salary 20. Write a query to display the employee id, name ( first name and last name ) and the job id column with a modified title SALESMAN for those employees whose job title is ST_MAN and DEVELOPER for whose job title is IT_PROG.
  • 14. 1. Write a SQL query to find the first name, last name, department, city, and state province for each employee. 2. Write a SQL query to find the first name, last name, salary, and job grade for all employees
  • 15. 3. Write a SQL query to find all those employees who work in department ID 80 or 40. Return first name, last name, department number and department name 4. Write a SQL query to find those employees whose first name contains the letter ‘z’. Return first name, last name, department, city, and state province
  • 16. 5. Write a SQL query to find all employees who joined on 1st January 1993 and left on or before 31 August 2005. Return job title, department name, employee name, and joining date of the job. 6. Write a SQL query to calculate the difference between the maximum salary of the job and the employee's salary. Return job title, employee name, and salary difference
  • 17. 7. Write a SQL query to find the department name and the full name (first and last name) of the manager 8. Write a SQL query to find the department name, full name (first and last name) of the manager and their city
  • 18. 9. Write a SQL query to find out the full name (first and last name) of the employee with an ID and the name of the country where he/she is currently employed.