KEMBAR78
Experiment No 8solution | PDF
0% found this document useful (0 votes)
15 views1 page

Experiment No 8solution

The document outlines various SQL queries related to employee data, including counting total employees, displaying department-wise employee counts, and calculating total and average salaries for specific job roles. It also includes tasks for listing total salaries by department and jobs with employee counts. The conclusion emphasizes the study of SQL Aggregate Functions.

Uploaded by

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

Experiment No 8solution

The document outlines various SQL queries related to employee data, including counting total employees, displaying department-wise employee counts, and calculating total and average salaries for specific job roles. It also includes tasks for listing total salaries by department and jobs with employee counts. The conclusion emphasizes the study of SQL Aggregate Functions.

Uploaded by

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

Example: Employee relation

Emp_no Emp_name Job Salary Dept_no


1365 Smith Clerk 8000 10
2110 John Manager 45000 20
2567 Harry Salesman 4500 20
2890 Johnson Salesman 15000 10
3454 Turner Analyst 25000 10
5678 James Clerk 8500 30
5999 Miller Salesman 13500 30
6845 Ford Salesman 5000 20
6890 Marin Manager 50000 10
7000 Allen Clerk 7500 20

1) Find total number of employees.


SELECT count( Emp_no) FROM Employee;
2) Display department number with number of employees in each department.
SELECT Dept_no,COUNT(Emp_no) FROM Employee GROUP BY Dept_no
3) Display total salary of all clerks.
Select sum(salary) from Employee Where Job=’Clerk’
4) Display average salary of all employees.
Select avg(salary) from Employee

5) List the department number and total salary payable in each department.

6) List the jobs and number of employees in each job in descending order of number of employees.
7) List jobs of all employees where salary is greater than or equal to 25000.

Conclusion: Thus we have studied SQL Aggregate Functions.

Page 2

You might also like