Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Tutorial 10 – Database Design

CSC343 - Introduction to Databases


Fall 2008
TA: Lei Jiang
Exercise 1: ER to Relational Schema
Convert follow ER schema to a relational schema, using the rules you learned in the class (the
cardinality constrains with both the maximum and minimum numbers being 1 are omitted for
clarity).
A01
E0
A02

A21 A31
A12
A11 E1 E2 R1 E3 A32
A13 (1,N) (0,N)
A33
(0,N)
AR11 R2 AR21
(1,1)

E4 A41

Solution:

E0(A01, A02, A12*, A13*, A21*, Atype)


E3(A31, A32, A33)
R1(A01, A31, AR11)
E4(A31, A41, AR21)
Exercise 2: ER to Relational Schema

Translate the following E-R schema into a relational schema. For each relation indicate the key and, for
each attribute, specify if null values can occur (supposing that the attributes of the E-R schema do not
admit null values)

E1(A11, A12, A13)


E2(A21,A11,A12, A22)
E3(A31)
E4(A41,A31,A21,A11,A12,)

R4(A11, A12, A31*,AR4*)


R45(A11, A12, Atype, A31*,AR4*)
R5(A11, A12, A31)
Exercise 3: ER to Relational Schema

Course(Code, Name)
CourseEdition(Code, StartDate, EndDate, Course, Instructor)
Class(Time, Room, Date, Edition)

Instructor(SSN, Surname, Age, TownOfBirth, Type)


Telephone(Number, InstructorSSN)
Qualification(Course, Instructor)

Employer(Name, Address, Telephone)


Trainee(Code, SSN, Surname, Age, TownOfBirth, Sex)
PastEmployment(Trainee, Employer, StartDate, EndDate)
Employee(TraineeCode, Level, Position, Employer, StartDate)
Professional(TraineeCode, Expertise, ProfessionalTitle*)
Attendance(Trainee, Edition, Marks*)

You might also like