SQLite Aggregate Functions and Group by- Exercises, Practice, Solution
Aggregate Functions and Group by [14 exercises with solution]
[An editor is available at the bottom of the page to write and execute the scripts. Go to the editor]
1. Write a query to list the number of jobs available in the employees table.
Sample table : employees
2. Write a query to get the total salaries payable to employees.
Sample table : employees
3. Write a query to get the minimum salary from employees table.
Sample table : employees
4. Write a query to get the maximum salary of an employee working as a Programmer.
Sample table : employees
5. Write a query to get the average salary and number of employees working the department 90.
Sample table : employees
6. Write a query to get the highest, lowest, sum, and average salary of all employees.
Sample table : employees
7. Write a query to get the number of employees with the same job.
Sample table : employees
8. Write a query to get the difference between the highest and lowest salaries.
Sample table : employees
9. Write a query to find the manager ID and the salary of the lowest-paid employee for that manager.
Sample table : employees
10. Write a query to get the department ID and the total salary payable in each department.
Sample table : employees
11. Write a query to get the average salary for each job ID excluding programmer.
Sample table : employees
12. Write a query to get the total salary, maximum, minimum, average salary of employees (job ID wise), for department ID 90 only.
Sample table : employees
13. Write a query to get the job ID and maximum salary of the employees where maximum salary is greater than or equal to $4000.
Sample table : employees
14. Write a query to get the average salary for all departments employing more than 10 employees.
Sample table : employees
... More
Structure of 'hr' database :

- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join