Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
65 views30 pages

MySQL Aggregate Functions Practice

This document provides examples of SQL queries using aggregate functions to analyze employee data in a database. It lists 14 queries to find things like the number of jobs, total salaries, minimum and maximum salaries, average salary by department, highest and lowest salaries overall, number of employees with the same job, difference between highest and lowest salary, lowest paid employee by manager, total salary by department, average salary by job excluding programmers, statistics by job for department 90, jobs where maximum salary is over $4000, and average salary for departments with over 10 employees. The document is signed by Sachin Jaiswal, head of the computer department at Nathu Ram Convent School.

Uploaded by

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

MySQL Aggregate Functions Practice

This document provides examples of SQL queries using aggregate functions to analyze employee data in a database. It lists 14 queries to find things like the number of jobs, total salaries, minimum and maximum salaries, average salary by department, highest and lowest salaries overall, number of employees with the same job, difference between highest and lowest salary, lowest paid employee by manager, total salary by department, average salary by job excluding programmers, statistics by job for department 90, jobs where maximum salary is over $4000, and average salary for departments with over 10 employees. The document is signed by Sachin Jaiswal, head of the computer department at Nathu Ram Convent School.

Uploaded by

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

MYSQL

Practice Session MySQL Aggregate functions

Sachin Jaiswal
MCA (HOD – Computer Dept.)
Nathu Ram Convent School
WRITE A QUERY TO LIST THE NUMBER OF
JOBS AVAILABLE IN THE EMPLOYEES TABLE.
WRITE A QUERY TO GET THE TOTAL SALARIES
PAYABLE TO EMPLOYEES.
WRITE A QUERY TO GET THE MINIMUM
SALARY FROM EMPLOYEES TABLE.
WRITE A QUERY TO GET THE MAXIMUM SALARY
OF AN EMPLOYEE WORKING AS A PROGRAMMER.
WRITE A QUERY TO GET THE AVERAGE SALARY AND
NUMBER OF EMPLOYEES WORKING THE
DEPARTMENT 90.
WRITE A QUERY TO GET THE HIGHEST,
LOWEST, SUM, AND AVERAGE SALARY OF
ALL EMPLOYEES.
WRITE A QUERY TO GET THE NUMBER OF
EMPLOYEES WITH THE SAME JOB.
WRITE A QUERY TO GET THE
DIFFERENCE BETWEEN THE HIGHEST
AND LOWEST SALARIES.
WRITE A QUERY TO FIND THE MANAGER
ID AND THE SALARY OF THE LOWEST-PAID
EMPLOYEE FOR THAT MANAGER.
WRITE A QUERY TO GET THE
DEPARTMENT ID AND THE TOTAL SALARY
PAYABLE IN EACH DEPARTMENT.
WRITE A QUERY TO GET THE AVERAGE
SALARY FOR EACH JOB ID EXCLUDING
PROGRAMMER.
WRITE A QUERY TO GET THE TOTAL SALARY,
MAXIMUM, MINIMUM, AVERAGE SALARY OF
EMPLOYEES (JOB ID WISE), FOR DEPARTMENT ID 90
ONLY.
WRITE A QUERY TO GET THE JOB ID AND MAXIMUM
SALARY OF THE EMPLOYEES WHERE MAXIMUM
SALARY IS GREATER THAN OR EQUAL TO $4000.
WRITE A QUERY TO GET THE AVERAGE SALARY FOR
ALL DEPARTMENTS EMPLOYING MORE THAN 10
EMPLOYEES.
END OF PRACTICE SESSION ON AGGREGATE
FUNCTIONS

Kindly do more practice on the topic


:From
Sachin Jaiswal
MCA (HOD – Computer Dept.)
Nathu Ram Convent School.

You might also like