Ho Chi Minh City University of Transport: Exercises Database Systems - 2021 /nvdieu
Ho Chi Minh City University of Transport: Exercises Database Systems - 2021 /nvdieu
Contents
0.1 Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1/7
Exercises Database Systems - 2021 /nvDieu
Require
1. Determine all the keys of the Relational Schemes.
2. Create database SMDB.
5.6. Find Subject (ID, Name and Grades) that Student ID = ”T02” fail.
5.7. Show all the Subject (*) that Student ID = ”T03” never took the exam.
5.8. Number of Students for each class.
5.9. Find the classes with the largest number of students.
5.10. GPA (grade point average) of student ID = ”T02”.
5.11. GPA for each student.
5.12. GPA of class ID = ”C02”.
5.13. GPA for each class.
5.14. Find students have the largest GPA.
5.15. Find students (ID and Name) have the largest GPA.
5.16. Find classes (ID and Name) have the largest GPA.
5.17. GPA with weight for each student.
5.18. GPA with weight for each student (ID and name).
5.19. GPA with weight for each class.
3/7
Exercises Database Systems - 2021 /nvDieu
Require
1. Determine all the keys of the Relational Schemes.
4/7
Exercises Database Systems - 2021 /nvDieu
Require
4. Insert all the required data for queries and integrity constraints.
5. Query by Relational Algebra and SQL:
5.1. All the products of category ID = ”C02”.
5.2. All the warehouses (*) that store category ID = ”C01”.
5.3. All the warehouses (*) in now store product name = ”beverage”.
5.4. All the products, it can be store in warehouse ID = ”W01”.
5.5. Calculating sum of quantity for each warehouses.
5.6. Find warehouse have the largest total quantities.
5.7. Calculating count of product for each warehouse.
5.8. Find warehouses have the largest number of product.
5.9. Calculating sum of quantity for each product.
5.10. Show products have the largest total of quantities.
5/7
Exercises Database Systems - 2021 /nvDieu
Require
6/7
Exercises Database Systems - 2021 /nvDieu
Require
4. Insert all the required data for queries and integrity constraints.
5. Query by Relational Algebra and SQL:
5.1. Provinces with an area larger than 15000 square kilometers.
5.2. Provinces(*) it neighbored with province have area larger than 15000 square kilometers.
5.3. Provinces (*) in the country name = ”North”.
5.4. Which Nation bordering the northern provinces.
5.5. Average area of the southern provinces.
5.6. Population density of the central country.
5.7. Provinces with the largest population density.
5.8. Provinces with the largest area.
5.9. In southern country, provinces with the largest area.
5.10. Provinces that have borders with two or more nations.
5.11. List of Countries with the number of its provinces.
5.12. Provinces with the largest total neighbor.
5.13. Provinces that are area larger than area of their neighboring provinces.
5.14. For each country, list the provinces with largest area.
5.15. For each country, list the provinces with population larger than the average population of that country.
5.16. Countries with the largest total area.
5.17. Countries with the largest total population.
6. Show all integrity constraints.
7. Tkinter GUI for this database.
7/7