Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Exercise series 3: join tables

1. Provide an overview of the offices with the employees who work there. Sort the list
alphabetically by office name and within each office alphabetically by employee name.

2. Provide a list of employees who are overpaid (earning more than the maximum salary
for their job). Sort the list according to decreasing salary.

3. Provide a list of employees who are overpaid. For each overpaid employee, also
provide the details of the office where he works. Sort the list according to decreasing
salary.

4. Calculate for each employee the difference between his salary and the corresponding
(according to the job) minimum salary. Provide the number of the employee, the name
of the employee, the salary, the minimum salary of his job and the positive or negative
difference. Sort the list by the calculated difference and then by name.

5. Same as previous exercise, but now with the exception of the rows in which the salary
is the same as the minimum salary.

6. Which offices are located in the same city? Place the offices per 2 and give the name
of the office and the city.
7. Provide all details of the employees who can be replaced. Sort by employee name.

8. Provide an alphabetical list of all employees with the job Analyst from the Sales sector.

9. Give all offices with the employees. Sort the list alphabetically by office name and
within each office alphabetically by employee name.

10. Specify the offices in which no employee works.


11. Provide an alphabetical list of the drivers that made a delivery for project P5.

12. Provide an alphabetical list of the drivers that delivered a quality 1 item.

13. Provide a list of the drivers with the project numbers they delivered for. Sort by dno.

14. Give the number of the articles delivered by driver D2 and by driver D3.

15. Provide the number and the name of the articles delivered by driver D2 and by driver
D3.

16. Provide the number and the name of the articles delivered by driver Jones and by
driver Blake.

17. Provide the number and name of the articles delivered by driver Jones or by driver
Blake.
18. Provide a list of the books with the data of the publisher (books.* and publishers.*). Sort
by bno.

19. Give the books with the author(s) (books.* and authors.*). Sort by bno and ano.

20. Give the books with the author(s) (books.* and authors.*). Keep only the books for
which the price is maximum 20 Euro. Sort by bno and ano.

21. Give the books with the author(s) (books.* and authors.*). Also display the publisher
data (publishers.*). Sort by bno and ano.

22. Give all publishers with the books they have published (publishers.* and books.*). Sort
by pno.

23. Give the publishers who haven't published any books.

24. Provide a list of the books with the data of the publisher (books.* and publishers.*).
Only the books whose title begins with 'De' are listed. Sort by bno.

You might also like