How does your ER diagram and schema change if a patient can undergo several surgeries (on di erent days, with possibly different surgeons) and if several surgeons can be involved in a single operation?

What will be an ideal response?


Solution:
Change to E-R diagram: dark arrow from patient to operation replaced by dark line.
Change to schema:


CREATE TABLE Operation (
Pid INTEGER,
Sid INTEGER,
Date DATE,
PRIMARY KEY (Sid, Date),
UNIQUE (Sid, Date),
FOREIGN KEY (Pid) REFERENCES Patient(Id),
FOREIGN KEY (Sid) REFERENCES Surgeon(Id))


Note: Adding constraint UNIQUE (Pid, Date) in an attempt to limit a patient to one
surgery a day will also eliminate the possibility of multiple surgeons performing a single
operation, so it is not included.

Computer Science & Information Technology

You might also like to view...

Which of the following is true about encryption algorithms?

A. their strength is tied to their key length B. not vulnerable to brute force attacks C. block ciphers encrypt one bit at a time D. asymmetric algorithms use a single key

Computer Science & Information Technology

How can you change the length of a String in a StringBuilder object?

What will be an ideal response?

Computer Science & Information Technology

Pete, a security administrator, would like to implement laptop encryption to protect data. The Chief Executive Officer (CEO) believes this will be too costly to implement and decides the company will purchase an insurance policy instead. Which of the following is this an example of?

A. Risk avoidance B. Risk deterrence C. Risk acceptance D. Risk transference

Computer Science & Information Technology

Explain what a journaling file system is, and detail the benefits of using such a filesystem.

What will be an ideal response?

Computer Science & Information Technology