Professional Documents
Culture Documents
ExerciseSeries4-Functions, GROUP BY and HAVING Clause
ExerciseSeries4-Functions, GROUP BY and HAVING Clause
HAVING clause
2. How many employees with job Programmer are there at the Technica office?
3. What is the average salary of the employees with job Analyst? Round off
mathematically to 0 decimal places.
5. For each job, give the lowest salary and the highest salary paid to an employee.
8. Provide the number of employees per sector with a salary between 50000 and 100000.
9. Give per city the number of employees that are overpaid (earning more than the
corresponding maximum salary).
10. Give the average salary per sector. Round off mathematically to 0 decimal places. Sort
by average.
11. Give the number of articles of which the quality is 1. Give also the total weight of these
articles.
12. Give the number of different values that appear in the quality column of the table
articles.
13. Give the number of projects to which driver D1 has delivered articles.
16. With the exception of deliveries by driver D1, for each article delivered, give the article
number and the total quantity delivered for that article.
19. Give the drivers (dno and dname) with at least 2 deliveries of article A1.
20. Give the number and the name of the driver and the article number for which the driver
delivered the article at least 3 times.
21. Give the average price per book category. Round off the average price to 2 decimals.
Sort by rising average price.
22. Give the number of authors per hometown. Sort alphabetically by hometown.
23. Give per publisher (pno, publisher) the number of books in the category Roman that he
has published.
24. Give the books that were published no more than 10 years ago. Sort by title.
25. Provide an alphabetical list of authors who this year have an age divisible by 5 (e.g. 45,
50, ...).