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

CSC371: Database Systems – Spring 2019

Assignment – 3 [CLO-C3]
Deadline: 11:59:59 pm, April 27, 2019 Max. Marks: 20

Schema Design by Decomposition


Problem-1: For each of the following collection of relations and functional dependencies, determine if
relation(s) is/are in BCNF. If not, then decompose it into a set of BCNF relations. [5]

1a- R1(A,C,B,D,E)

A → B, C → D

1b- R2(A,B,F)

AB → F, B → F

1c- R3(A,B), R4(C,D,E,F)

A → B, C → D, D → EF

1d- R5(A,B,C,D,E)

D → B, CE → A

1e- R6(A,B,C,D,E)

A → E, BC → A, DE → B

Problem-2: Given below is the set of functional dependencies for the relational schema: R = (A, B, C, D,
E, F, G) [2.5]

A, B → C

B, C → D

A, E → F, G

2a- Find ALL minimal keys for the relation R.

2b- Decompose the relation into a set of relations that are in BCNF.

Problem-3: Given below is the set F of functional dependencies for the relational schema: R = (A, B, C, D,
E, F) [2.5]

A→B

B → C, D

D → F, A

3a- Find ALL minimal keys for the relation R.

3b- Now decompose these relations into a set of relations that are in BCNF
Entity Relationship Modeling
For each of the following problems, first create an entity relationship (ER) diagram and then convert it into
a relational database schema

Problem-1: Bank database [5]

▪ Each bank has a unique ID, name, and headquarter address.


▪ Each bank has many branches, and for each branch we need to keep the branch ID (unique within
the bank but not unique across different banks), location, and telephone number.
▪ Customers can have many accounts at the same branch or at different branches. An account has
a unique account ID, type (E.g., savings or current), currency (e.g., pkr, dollar, euro), and balance.
▪ A customer can take many loans from different branches. For each loan we need to keep the loan
amount and the year.
▪ Each customer has a CNIC (unique ID), name, address, and date of birth properties.
▪ We need to capture the transactions done by each customer over each account. We capture the
type of the transaction (E.g., either withdrawal or deposit), the transaction time, and the amount.

Problem-2: University database [5]

▪ We have students; each student has a unique ID, name, address, gender, major, and overall GPA
▪ We have courses, each course has a unique CourseID, title, and number of credits
▪ Students will register in courses in certain semesters. We need to keep track of the grade that a
student has received in a given course. The model should allow a student to take the same course
in different semesters.

You might also like