



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Figure 1 shows the ER diagram.
P r o je c t
D e p a r t m e n t
S S N N a m e R a n k P I D
S _ D a t e
E _ D a t e
D e p t N O N a m e O f f ic e
P r o f e s s o r
T i m e_ P ct
W o r k I n (^) R u n
W o r k O n
M a n a g e
R e p r e s e n t s M a n y - t o - O n e r e la t io n s h ip
R e p r e s e n t s R e f e r e n t ia l I n t e g r it y
Figure 1: ER Diagram 1
Figure 2 shows the ER diagram. The solid parts are those added on from the ER-diagram in Prob 1.
P r o f e s s o r P r^ o^ je^ c t
D e p a r t m e n t
S S N N a m e R a n k P I D
S _ D a t e
E _ D a t e
D e p t N O (^) N a m e O f f ic e
T i m e_ P ct
G r a d u a t e S t u d e n t
S S N
N a m e
P ro g ram
R e s e a r c h As s is t a n t O f f ic e
g r a d s e n io r
W o r k O n
M a n a g e
W o r k I n R u n
W o r k O n
Ad v ic e s
M a jo r I n
Figure 2: ER Diagram 2
Subclasses are used when there are certain entities in an entity set that have special properties not associated with all members of the set. We create an entity set for those entities with their special properties and/or relation- ships. One example is that for the entity set Graduate Student in Problem 2, we have some Graduate Students being Research Assistants. Therefore,
Professor(SSN , Name, Rank) Project(P ID, S Date, E Date) Department(DeptN O, Name, Office) WorkOn(SSN , P ID) Manage(SSN, P ID) WorkIN(SSN , DeptN O, Time Pct) Run(SSN, DeptN O)
If we use many-one relationship to reduce the number of relations, we could combine the Project relation with the Manage relation, and the De- partment relation with the run relation. Therefore, we will get: Professor(SSN , Name, Rank) Project(P ID, S Date, E Date, SSN) Department(DeptN O, Name, Office, SSN) WorkOn(SSN , P ID) WorkIN(SSN , DeptN O, Time Pct)
(a) First we consider subset A. No FD could be found. Therefore, we have A+=A. For subset CD. We can get CD+=ABCD, using FDโs CD โ A and AD โ B. For subset ABD. We can get ABD+=ABCD, using FD AB โ C. (b) One way to deduce all dependencies is to consider the closures of all 15 nonempty subsets of attributes. To begin with, letโs start with the subset with a single attributes, i.e., A+ = A, B+ = B, C+ = C, and D+ = D. Thus, there is no nontrivial dependency with a single attribute. Now consider the subset with a pair of attributes: From AB+ = ABCD, we get AB โ D. From BC+ = ABCD, BC โ A. From CD+ = ABCD, CD โ B. From AD+ = ABCD, we get AD โ C. For the subset with triples, the closures of the sets are ABCD, from which we get ABC โ D, ABD โ C, ACD โ B, and BCD โ A. Finally, from ABCD+ = ABCD, we get no new dependencies. Therefore, all the nontrivial FDโs besides the ones are given are: AB โ D, BC โ A, CD โ B, AD โ C, ABC โ D, ABD โ C, ACD โ B, and BCD โ A.
(c) According to our development for (a), we find AB, BC, CD and AD are keys, as they have ABCD as their closures. (It is fine if the superkeys are also listed)
Before we start to finding any violations, we need to know all the nontrivial FDโs. Follow the same scheme as Problem 5, we can get the following non- trivial FDโs: B โ D, AB โ C, AB โ D, BC โ D, BE โ C, BE โ D, DE โ C, ABC โ D, ABE โ C, ABE โ D, ADE โ C, ABCE โ D, ABDE โ C. From the FDโs above, we can infer that the key for R is ABE.
(a) All the BCNF violations are: B โ D, AB โ C, AB โ D, BC โ D, BE โ C, BE โ D, DE โ C, ABC โ D, ADE โ C.
(b) Suppose we decompose using AB โ CD, which gives us ABCD and ABE as decomposed relations. ABE is in BCNF. but ABCD is not (vio- lations: B โ D, BC โ D). We further decompose ABCD by using FD B โ D, which gives us BD and ABC. Both BD and ABC are in BCNF (Note, there can be multiple right answers, depending on which FDs used in which order.)
(a) in 3NF but not in BCNF Relation R(A, B,C, D) having FDโs are AB โ D, D โ C, C โ A. One of the FDโs that violates BCNF is D โ A as the keys for this relation are AB, BC and BD. However, there is no FD that violates 3NF. (b) in BCNF but not in 4NF Example 3.37 in the text book, Page 123. (c) in 4NF Relation R(A,B,C) having A as key. FDโs are A โ B, A โ C. No violation.
10 pts
Yes.