Group By
Solutions and examples for MySQL.
Showing 1–14 of 14 problems
- 01Show each region_id and corresponding no of countries in that region from countries table
- 02Show the location_id and corresponding no of departments in that location from departments table
- 03For each department_id, show the no of employees in that department from the employees table
- 04For each manager_id, show the no of employees under his supervision from the employees table
- 05For each job_id, show the no of employees in that job type from the employees table
- 06For each department_id, show the no of managers from that department using employees table
- 07Show the department wise total no of employees, maximum and minimum salary in that department, average and total salary paid for that department from the employees table
- 08For each year, show the total no of employees who were hired during that year from the employees table
- 09Show the total no of jobs within 0k to 10k, 10k to 20k and so on salary ranges(max_salary-min_salary) groups from the jobs table
- 10For each job_id and each department, show the total no of employees in that group from the employees table
- 11For each year and each month show the total no of employees who have left their jobs from the job_history table
- 12For each country_id, show the total no of locations in that country from the locations table
- 13For each city, show the total no of locations in that city from the locations table
- 14Group employees based on the first letter of their names