Question

In: Computer Science

a) Construct an E-R diagram for a hospital with a set of patients and a set...

a)

Construct an E-R diagram for a hospital with a set of patients and a set of medical doctors.

Associate with each patient a log of the various tests and examinations conducted.

b)

Construct appropriate relation schemas for the E-R diagram. (ex. customer(name, birth, ID...))

Solutions

Expert Solution

Solution:

(a) The final E-R diagram will consist of entity sets of Patient, Doctor, Hospital, Test. They will have their own set of attributes. For example: a Hospital will have Name, ID, Address, Speciality; a Patient will have Name, ID, Date Admitted, Date checked-out and a doctor will have Name, ID, Specialization, Registration number. Similarly Test will have attributes like disgnosis, name, date conducted, result.

A hospital will have many patients (one-to-many relation). Also, a hospital will have many doctors (one-to-many relation).

Each test will have at least one test log and will be performed by a doctor.

(b) Converting the E-R diagram into relation schema/tables:

As per E-R diagram, the tables will be needed for Patient, Hospital, Doctor, Test and Performed_By. Here is the explanation for each:

1. Patient: Since, it has cardinality ratio of N:1 with the Hospital entity set, hence it will consume the relationship and will have the primary key of Hospital as a foreign key in addition to its own key and other attributes. So the Patient table will look like:

Patient(Hospital.id, id, Name, Date_admitted, Date_checked_out)

2. Hospital: This will have id as they the key along with other attributes. It will look like:

Hospital(id, Name, Address, Speciality)

3. Doctor: Since, it has cardinality ratio of N:1 with the Hospital entity set, hence it will consume the relationship and will have the primary key of Hospital as a foreign key in addition to its own key and other attributes. So the Doctor table will look like:

Doctor(Hospital.id, id, Name, Specialization, Registration_no)

4. Test: Since it has complete participation constraint with Patient entity set and hence it will also have cardinality ratio of N:1 with the Patient entity set. Therefore, it will consume the test_log relationship and will have primary key of Patient as a foreign key in addition to its own key and other attributes. So the Test table will look like:

Test(Test_Name, Date, Diagnosis, Result, Patient.id)

5. Performed_By: This is a relationship set which will have its own table and have primary key of Test table and primary key of Doctor table as its candidate keys. This table will look like:

Performed_By(Test.Test_Name, Doctor.id)

Answer: The relation schema will be as follows:

Patient(Hospital.id, id, Name, Date_admitted, Date_checked_out)

Hospital(id, Name, Address, Speciality)

Doctor(Hospital.id, id, Name, Specialization, Registration_no)

Test(Test_Name, Date, Diagnosis, Result, Patient.id)

Performed_By(Test.Test_Name, Doctor.id)


Related Solutions

Construct an E-R diagram for a hospital with a set of patients and a set of...
Construct an E-R diagram for a hospital with a set of patients and a set of medical doctors. Associate with each patient a log of the various tests and examinations conducted. Use your best judgement to identify the attributes for each of those entities.
Create an E/R diagram for the following business situation and convert the diagram into a set...
Create an E/R diagram for the following business situation and convert the diagram into a set of related tables: A health insurance company sells a number of insurance policies. Employer companies can buy any number of policies including zero and up to 4. A policy must be bought by at least one employer. Employees working for the employers can select at most one insurance policy. A policy can be selected by any number of employees including zero. Employees can add...
1a. Construct (draw) an E-R diagram representing the conceptual design of the database. Be sure to...
1a. Construct (draw) an E-R diagram representing the conceptual design of the database. Be sure to identify primary keys, relationship cardinalities, etc. State any assumptions you make. 1b. Convert your E-R diagram to the relational schema. Identify the primary keys of ever relation. Consider the following application: An electronics vendor operates both a Web site and a chain of many physical stores. Examples include Best Buy and Circuit City. To find out more about this application, think about any experiences...
For your written assignment: Construct an E-R diagram for a car-insurance company whose customers own one...
For your written assignment: Construct an E-R diagram for a car-insurance company whose customers own one or more cars each. Each car has associated with it zero to any number of recorded accidents.
Construct a scattergram for each data set. Then calculate r and r 2 for each data...
Construct a scattergram for each data set. Then calculate r and r 2 for each data set. Interpret their values. Complete parts a through d a. x −1 0 1 2 3 y −3 0 1 4 5 Calculate r. r=. 9853 ​(Round to four decimal places as​ needed.) Calculate r2. r2=0.9709. ​(Round to four decimal places as​ needed.) Interpret r. Choose the correct answer below. A.There is not enough information to answer this question. B.There is a very strong...
Construct a scattergram for each data set. Then calculate r and r2 for each data set....
Construct a scattergram for each data set. Then calculate r and r2 for each data set. Interpret their values. Complete parts a through d. a. x −1 0 1 2 3 y −3 0 1 4 5 Calculate r. r=. 9853.​(Round to four decimal places as​ needed.) Calculate r2. r2=0.9709​(Round to four decimal places as​ needed.) Interpret r. Choose the correct answer below. A.There is not enough information to answer this question. B.There is a very strong negative linear relationship...
For this step, you should draw an E-R Diagram for this dataset. To this goal, you...
For this step, you should draw an E-R Diagram for this dataset. To this goal, you should conduct the following steps: 1. Identify the entities and composite entities 2. Identify the entities’ attributes and primary key 3. Identify the relationships among the entities and between entities and composite entities 4. Specify the relationships' integrities
Draw an E-R diagram for each of the following situations (if you believe that you need...
Draw an E-R diagram for each of the following situations (if you believe that you need to make additional assumptions, clearly state them for each situation): 1. A laboratory has several chemists who work on one or more projects. Chemists also may use certain kinds of equipment on each project. Attributes of CHEMIST include Employee_ID (identifier), Name, and Phone- No. Attributes of PROJECT include ProjecUD (identifier) and Start_Date. Attributes of EQUIPMENT include Serial_No and Cost. The organization wishes to record...
What is the Proper E/R diagram for these 5 Departments Entities that support the Volunteer management...
What is the Proper E/R diagram for these 5 Departments Entities that support the Volunteer management software: Volunteer-Details (entity) Volunteer-name (Entity) Volunteer-age(entity) Volunteer-sex (entity) Volunteers clocked in (entity) Volunteers clocked out (entity) Entities that support the Guest management software: Guest (entity) Admission (entity) Guest-name (entity) Guest-age (entity) Guest-sex (entity) Beds(entity) Shower (entity) Laundry-service (entity) Meals (entity) Basic-medical-care (entity) Emergency-services(entity) Rule-Violation (entity) Entities that support the Scheduling software: Volunteer Shifts(entity) Monday Tuesday Wednesday Thursday Friday Saturday Sunday Employee Shifts (entity) Monday...
a) Design an E-R diagram for keeping track of the scoring statistics of your favorite sports...
a) Design an E-R diagram for keeping track of the scoring statistics of your favorite sports team. You should store the matches played, the scores in each match, the players in each match, and individual player scoring statistics for each match. Summary statistics should be modeled as derived attributes with an explanation as to how they are computed. b) Construct appropriate relation schemas for the E-R diagram (ex. customer(name, ID, birth))
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT