HS2021 Database Design and Use Individual Assignment Solution
VerifiedAdded on 2022/09/14
|49
|3602
|20
Homework Assignment
AI Summary
This assignment solution focuses on database design and implementation using SQL. It begins with describing the relationships within an Entity-Relationship Diagram (ERD) involving tables like CUSTOMER, SALESPERSON, SHOPORDER, PRODUCT, and ORDERLINE. The solution includes SQL statements for dropping and creating these tables, defining primary and foreign keys, and incorporating check constraints. Data insertion is demonstrated with sample values, and the solution addresses constraint errors. The assignment then explores database queries, including counting total and female orders, grouping data by gender, and ordering results. Additional tables, such as MANAGER, QUALITYCHECK, and ALLOCATION, are created and populated. The solution covers various SQL queries, including those involving joins, aggregations, and subqueries to retrieve specific information, such as price differences, combined names, and addresses. The assignment concludes with queries using left outer joins, grouping by customer and product, and filtering based on specific criteria like the total sold quantity and average quality scores. A bibliography of relevant database systems resources is also provided.
1 out of 49