You are on page 1of 1

Tutorial 5 – Relational Data Model

Instructions:
1. Create a database named ‘Premiere’, and use the ‘Premiere’database.
2. Populate the tables and records by executing ‘premiere.sql’ (download from e-learning).
3. Ensure all the tables exist and their records respectively.

Questions:

Develop the Relational Data Model (RDM) which corresponds to the ‘Premiere’ database Your
RDM should identify primary and foreign keys. Your RDM should be presented in the following
format:
TABLENAME (attribute1, attribute2, attribute3, …)
PRIMARY KEY attribute1
FOREIGN KEY attribute3 REFERENCES table name

Solutions:
Rep(RepNum,LastName, FirstName, Street, City, State, Zip, Commission, Rate)
Primary key: RepNum

Customer(CustomerNum, CustomerName, Street, City, State, Zip, Balance, CreditLimit,


RepNum)
Primary key: CustomerNum
Foreign Key RepNum References Rep(RepNum)

Orders(OrderNum, OrderDate, CustomerNum)


Primary key: OrderNum
Foreign Key: CustomerNum References Customer(CustomerNum)

OrderLine(OrderNum, PartNum, NumOrdered, QuotedPrice)


Primary key: OrderNum, PartNum
Foreign Key: OrderNum References Order(OrderNum)
Foreign Key: PartNum References Part(PartNum)

Part (PartNum, Description, OnHand, Class, Warehouse, Price)


Primary key: PartNum

You might also like