Академический Документы
Профессиональный Документы
Культура Документы
a) R= {A, B, C, D, E}
F = {E A, CD E, A BC, BD}
D = {(ABC), (ADE)}
Answer: Lossless
b) R (A, B, C, D, E)
F = {AB C, C D, B E}
D = { (ABC), (CD), (DE)}
Answer: Lossy
CO2 Q5. Consider an Entity-Relationship (ER) model in which entity sets E1 and E2 are connected by (5 marks)
an m : n relationship R12. E1 and E3 are connected by a 1 : n (1 on the side of E1 and n on the
side of E3) relationship R13. E1 has two single-valued attributes a11 and a12 of which a11 is the
key attribute. E2 has two single-valued attributes a21 and a22 of which a21is the key attribute. E3
has two single-valued attributes a31 and a32 of which a31 is the key attribute. The relationships
do not have any attributes. Map the above ER diagram to appropriate Relational Schema
with all primary and foreign keys.
Answer:
E1(a11, a12)
E2(a21, a22)
E3(a31, a32, a11)
R12(a11, a21)
CO3 Q6. Compute the canonical cover of the following set of functional dependencies of R(ABCDE) (5 marks)
F = { A D, BC AD, C B, E AD }
Answer: { A D , C AB , E A }
Answer:
Weak Entity – An entity that does not have a key attribute of its own. The existence of a weak
entity set depends on the existence of a identifying entity set
it must relate to the identifying entity set via a total, one-to-many relationship set from
the identifying to the weak entity set
Identifying relationship depicted using a double diamond
CO3 Q8. Given R (A,B,C,D,E,F,G,H,I,J) and set of functional dependencies F = { AB C, (5 marks)
B F, A DE, DIJ, FGH}. Decompose the relation into their highest normal form.
Check whether the decomposition is satisfying dependency preservation and lossless join
condition or not.
Solution:
Candidate Key : AB
Given relation is in 1NF because of the partial dependencies – B F, A DE
For 2NF: R1 (ABC), R2 (ADEIJ) & R3 (BFGH)
For 3NF and BCNF: R1 (ABC), R21 (ADE), R22 (DIJ), R31 (BF), R32 (FGH)
Dependency preservation and lossless join condition are satisfied.
Patients are identified by an SSN, and their names, addresses, and ages must be recorded.
Doctors are identified by an SSN. For each doctor, the name, specialty, and years of
experience must be recorded.
Each pharmaceutical company is identified by name and has a phone number.
For each drug, the trade name and formula must be recorded. Each drug is sold by a given
pharmaceutical company, and the trade name identifies a drug uniquely from among the
products of that company. If a pharmaceutical company is deleted, you need not keep track of
its products any longer.
Each pharmacy has a name, address, and phone number.
Every patient has a primary physician. Every doctor has at least one patient.
Each pharmacy sells several drugs and has a price for each drug. A drug could be sold at
several pharmacies, and the price could vary from one pharmacy to another.
Solution: