You are on page 1of 1

SYSC 5703 – Assignments I – Fall 2018 – Submit your solution on cuLearn

Mark = 5% and Due date = Oct. 17, 2018


Question 1 [8 marks]

Consider the schema R over the attributes KNLMDFG with the following functional
dependencies:
KN → L
LM → N
LMN → D
D→M
M → FG

and the following multivalued dependencies:

MVD-1: R = NLK  NDMFG


MVD-2: R = KNMF  FLDG

Decompose this schema into 4NF using the following method:


i. First obtain a BCNF decomposition using the FDs only (i.e. minimal cover, 3NF,
then BCNF)
ii. Then proceed to apply the MVDs to further normalize the schemas that are not yet
in 4NF. List the 4NF schemas.

Question 2 [4 marks]

Consider the following schema:

OFFERINGS (Course, Semester)


ENROLLMENT (StudId, Course, Semester)

Write a statement level trigger, which removes courses from OFFERINGS for all those courses
whose enrollment falls below 10 students. Note that the trigger must happen after delete, insert,
and update.

Question 3 [8 marks]
Student (Id, Name, Country)
Course (CrsCode, CrsName, Type, Instructor)
Results (Id, CrsCode, Grade)

All the key fields are underlined. The Type field specifies the course type, e.g. MATH, STAT,
SYSC, TTMG, ELEC, etc. The Results relation lists the grade that students (in Student relation)
obtain for courses (in Course relation). Write the following queries in (i) relational algebra and
(ii) SQL.
a. Find the Id of students who take TTMG or SYSC course.
b. Find the Id of students who take every course.

You might also like