COMP3311 Final Exam 20T3 The University of New South Wales
COMP3311 Database Systems
Final Exam 20T3
Database Systems
[Front Page] [Notes] [Database] [Course Website] [Cheat Sheets]
[Q1] [Q2] [Q3] [Q4] [Q5] [Q6] [Q7] [Q8] [Q9] [Q10] [Q11] [Q12]

Question 8 (8 marks)

Convert each of the following ER diagram fragments into a relational schema expressed as a collection of PostgreSQL CREATE TABLE statements. Your schemas must show all primary key constraints and foreign key constraints. None of the attributes a, b, c, e, f, g may contain null values. Determine other not null constraints from the context. You may add any new attributes that you need to represent all aspects of the ER diagram; assign them types and constraints as appropriate. The precise name of any new attributes is not important, as long as they are different from existing attributes. Also, document any semantic aspects suggested by the diagram which cannot be represented in the relational schema using standard SQL constraints.

Use the following to determine the type of each attribute:

Exercises:

  1. Map this entity and its attributes into an SQL schema.

  2. Map this ER design into an SQL schema.

  3. Map this class hierarchy to an SQL schema using the ER mapping.

Instructions:

End of Question