0% found this document useful (0 votes)
44 views5 pages

Group Functions: Objective

This document outlines the objectives and tasks for Lab #6 on database management systems. The tasks involve writing SQL queries to: 1) Find project numbers that involve an employee named Scott; 2) Calculate new salaries with a 10% raise for employees on a specific project; 3) Summarize salary details for a department; 4) Find employees who work on all projects in a department. Additional tasks involve writing queries to: 5) Find departments with more than 5 high-paid employees; 6) Find highest customer grade per city; 7) Count salesmen per city; 8) Find average grade per unique city.

Uploaded by

kanwar zain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views5 pages

Group Functions: Objective

This document outlines the objectives and tasks for Lab #6 on database management systems. The tasks involve writing SQL queries to: 1) Find project numbers that involve an employee named Scott; 2) Calculate new salaries with a 10% raise for employees on a specific project; 3) Summarize salary details for a department; 4) Find employees who work on all projects in a department. Additional tasks involve writing queries to: 5) Find departments with more than 5 high-paid employees; 6) Find highest customer grade per city; 7) Count salesmen per city; 8) Find average grade per unique city.

Uploaded by

kanwar zain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

LAB#06: DATABASE MANAGEMNET SYSTEM SSUET/QR/114

LAB # 6
GROUP FUNCTIONS

OBJECTIVE
• Identify the available group functions
• Describe the use of group functions
• Group data by using the group by clause
• Include or exclude grouped rows by using the having clause

LAB TASKS

Write SQL queries to


i. Make a list of all project numbers for projects that involve an employee whose last name
is ‘Scott’, either as a worker or as a manager of the department that controls the project.

ii. Show the resulting salaries if every employee working on the ‘IoT’ project is given a 10
percentraise.

Page 1
This study source was downloaded by 100000815639689 from CourseHero.com on 05-10-2022 20:53:05 GMT -05:00

https://www.coursehero.com/file/142820707/lab-6-ARINApdf/
LAB#06: DATABASE MANAGEMNET SYSTEM SSUET/QR/114

iii. Find the sum of the salaries of all employees of the ‘Accounts’ department, as well as the
maximum salary, the minimum salary, and the average salary in this department

iv. Retrieve the name of each employee who works on all the projects controlled by department
number (use NOT EXISTS operator).

Page 2
This study source was downloaded by 100000815639689 from CourseHero.com on 05-10-2022 20:53:05 GMT -05:00

https://www.coursehero.com/file/142820707/lab-6-ARINApdf/
LAB#06: DATABASE MANAGEMNET SYSTEM SSUET/QR/114

v. For each department that has more than five employees, retrieve the department number and the
number of its employees who are making more than Rs.6,00,000.

2. From the following table,

TABLE:

i. write a SQL query to find the highest grade of the customers for each of the city. Return
city, maximum grade.

Page 3
This study source was downloaded by 100000815639689 from CourseHero.com on 05-10-2022 20:53:05 GMT -05:00

https://www.coursehero.com/file/142820707/lab-6-ARINApdf/
LAB#06: DATABASE MANAGEMNET SYSTEM SSUET/QR/114

Page 4
This study source was downloaded by 100000815639689 from CourseHero.com on 05-10-2022 20:53:05 GMT -05:00

https://www.coursehero.com/file/142820707/lab-6-ARINApdf/
LAB#06: DATABASE MANAGEMNET SYSTEM SSUET/QR/114

ii. write a SQL query to find the total number of Salesman in each city. Return total salesman
and city name.

iii. Write a SQL query to compute the average grade for unique city. Return average price and city
name.

Page 5
This study source was downloaded by 100000815639689 from CourseHero.com on 05-10-2022 20:53:05 GMT -05:00

https://www.coursehero.com/file/142820707/lab-6-ARINApdf/
Powered by TCPDF (www.tcpdf.org)

You might also like