CS FundamentalsHardGATE CS · PSU (ISRO/BARC)
Entity sets Doctor, Patient and Drug participate in a single ternary relationship Prescribes with no cardinality constraints. Each entity set has its own key. What is the minimum number of tables, and what is the key of the Prescribes table?
- A. 6 tables; one per pair of entities
- B. 3 tables; Prescribes folded into Patient
- C. 4 tables; key = (doctor key, patient key)
- D. 4 tables; key = (doctor key, patient key, drug key)
Correct answer: D. 4 tables; key = (doctor key, patient key, drug key)
A many-many-many ternary relationship needs its own table whose key is the combination of all three participating keys; pairwise tables would not capture which drug was prescribed by which doctor to which patient.
More DBMS and SQL questions
- Table Staff(id, name, dept, pay, boss) rows: (1, 'Anu', 'Ops', 40, NULL), (2, 'Bala', 'Ops', 55, 1), (3, 'Chitra', 'Tech', 70, 1), (4…
- For the schedule W3(A), W3(C), R2(A), R1(A), W1(B), W4(A), R2(C), W4(B), how many serial schedules of T1–T4 are conflict-equivalent to it?
- R(A, B, C, D, E, F) has functional dependencies EF → D, A → C, BE → F, F → A, DF → A. What is the highest normal form R satisfies?
- Table Sale(id, rep, region, amt) rows: (1, 'Ira', 'N', 100), (2, 'Jai', 'S', 250), (3, 'Ira', 'S', NULL), (4, 'Kim', 'N', 300), (5, 'Jai'…
- Table Staff(id, name, dept, pay, boss) rows: (1, 'Anu', 'Ops', 40, NULL), (2, 'Bala', 'Ops', 55, 1), (3, 'Chitra', 'Tech', 70, 1), (4…
- A file has 30,000 records of 120 bytes, stored unspanned in 1024-byte blocks and ordered on key K. A primary (sparse) index on K has one…