Assignment 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.
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.
State what each relational algebra expression below computes (4 x 0.5 points):
For each of the relations U, V, and W, answer the following questions. Make sure you justify your answer.
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.