0% found this document useful (0 votes)
19 views

Assignment 2

This document provides instructions and questions for Assignment 2 of a Data Management course. It includes: 1) Rules stating the assignment must be individual work and details for submission. 2) Part A asks students to determine the minimum and maximum cardinalities for various relational algebra expressions involving relations R and S. 3) Part B provides relations with functional dependencies and asks students to identify candidate keys, minimal covers, and lossless decompositions to BCNF. 4) Part C asks students to determine if provided relations are in 3NF and BCNF and justify their answers.

Uploaded by

samia lachgar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Assignment 2

This document provides instructions and questions for Assignment 2 of a Data Management course. It includes: 1) Rules stating the assignment must be individual work and details for submission. 2) Part A asks students to determine the minimum and maximum cardinalities for various relational algebra expressions involving relations R and S. 3) Part B provides relations with functional dependencies and asks students to identify candidate keys, minimal covers, and lossless decompositions to BCNF. 4) Part C asks students to determine if provided relations are in 3NF and BCNF and justify their answers.

Uploaded by

samia lachgar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment 2

Rules
Recall that this class has zero tolerance for breaches of academic integrity. The assignments are individual work.
You can discuss the assignments with your classmates but you have to write your own answers, submit
individually, and write down the names of the people (and AI agents such that ChatGPT!) you discussed with on
the submitted work. Recall that late submissions are not accepted. Type your answers. Scanned handwritten
submissions are also not accepted.

Part A : Relational Algebra (8)


Question 1 : Relational Algebra (6 points)

Consider the two relations R and S with cardinality r and s respectively such that r > s > 0. For each of the
following relational algebra expressions, indicate the minimum and maximum cardinality for the resulting relation,
and state any assumptions about the schemas for R and S needed to make the expression meaningful. Justify
your answers. (12 x 0.50 points)

(1) R ∪ S,
(2) R ∩ S,
(3) R - S,
(4) S - R,
(5) σa=5(R),
(6) πa(R),
(7) R/S,
(8) S/R,
(9) R ⋈R.a = S.a S
(10) R ⟕R.a = S.a S
(11) R ⟖R.a = S.a S
(12) R ⟗R.a = S.a S

To be able to answer questions 9-12, read about outer joins in the new uploaded slides for week 2: slides 42 to
45.

Question 2 : Relational Algebra (2 points)

Consider the following schema:

Students (sid: integer, sname: string)


Classes (cid: string, pid: integer, cname: string)
Professors (pid: integer, pname: string)
Grades (sid: integer, cid: string, grade: string)

State what each relational algebra expression below computes (4 x 0.5 points):

1. πsname (πsid ( πcid ( σClasses.cname=“Data Management 1” (Classes)) ⨝ Grades) ⨝ Students)


2. πGrades.sid (Grades) - πGrades.sid ( σGrades.grade=”A” (Grades))
3. πid,name (ρ(Students(1->id,2->name),Students)) ∪ πid,name (ρ(Professors(1->id,2->name),Professors))
4. πsname ((Students ⨝ (πGrades.sid,Grades.cid (Grades))) / πcid (σProfessors,pname=“Echihabi” (Professors) ⨝ πcid,pid (Classes)) )

Data Management I (2023/2024) -- Prof. Karima Echihabi 1/2


Part B: Functional Dependencies (8 points)
Consider the two relations U, V and W, each with its own set of functional dependencies.

U (U1, U2, U3, U4)


U1 → U2, U3, U4
U3 → U1, U2

V (V1, V2, V3, V4, V5, V6, V7)


V1 → V2, V3
V1, V2, V3 → V4

W (W1, W2, W3, W4, W5, W6)


W1 → W2, W3
W1, W3 → W4, W5, W6
W6 → W1, W2

X (X1, X2, X3, X4, X5, X6)


X2X3→ X4
X4X5 → X1X6
X2X3→ X5

For each of the relations U, V, and W, answer the following questions. Make sure you justify your answer.

1. List all of the candidate keys. (3x1 points)


2. Give the minimal cover of the set of functional dependencies. (3x1 points)
3. Decompose the relation V into two relations V’ and V’’ that are both in BCNF, with a lossless and
dependency-preserving decomposition. (1 points)
4. Decompose the relation X into two relations X’ and X’’ that are both in BCNF, with a lossless and
dependency-preserving decomposition. (1 point)

Part C: Normalization (4 points)

For each of the relations U, V, W and Z, indicate whether it is in 3NF (4x0.50 points) or BCNF (4x0.50 points),
indicate its normal form? Justify your answers.

Data Management I (2023/2024) -- Prof. Karima Echihabi 2/2

You might also like