Considering the tables of the Hospital database given below, identify candidate keys, primarykeys, and foreign keys. Also, give an example of derived attributes for patient and doctor.patients (patient-id, name, Date of Birth, insurance, date-admitted, date-checked-out)doctors (doctor-id, NIC, name, date of birth, specialization)test (testid, test_name, date, time, result)doctor-patient (patient-id, doctor-id)test-log (testid, patient-id)performed-by (testid, doctor-id)
Question
Considering the tables of the Hospital database given below, identify candidate keys, primarykeys, and foreign keys. Also, give an example of derived attributes for patient and doctor.patients (patient-id, name, Date of Birth, insurance, date-admitted, date-checked-out)doctors (doctor-id, NIC, name, date of birth, specialization)test (testid, test_name, date, time, result)doctor-patient (patient-id, doctor-id)test-log (testid, patient-id)performed-by (testid, doctor-id)
Solution
Candidate Keys:
- patients: patient-id, insurance
- doctors: doctor-id, NIC
- test: testid
- doctor-patient: patient-id, doctor-id
- test-log: testid, patient-id
- performed-by: testid, doctor-id
Primary Keys:
- patients: patient-id
- doctors: doctor-id
- test: testid
- doctor-patient: (patient-id, doctor-id)
- test-log: (testid, patient-id)
- performed-by: (testid, doctor-id)
Foreign Keys:
- doctor-patient: patient-id (references patients), doctor-id (references doctors)
- test-log: testid (references test), patient-id (references patients)
- performed-by: testid (references test), doctor-id (references doctors)
Derived Attributes:
- patients: Age (derived from Date of Birth)
- doctors: Years of Experience (could be derived from the date they started their specialization)
Similar Questions
Which are entities of a patient data base in a doctor's office which has one doctor?*1 pointpatient, doctorpatient, visitdoctor, sicknesspatient, office
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.
MyDoc is a medical center that has been offering health services in Australia for the last decade. Till now, they have been using a spreadsheet to store their patient and appointment data. Now, they have decided to use a centralized relational database to store their data. Let’s assume that you have been hired to design their database. Given the following business rule, you need to design the database of MyDoc. Business Rules: • Details such as a unique ID, name, and address need to be stored for every doctor. There are two types of doctors: GPs and Surgeons. For a GP, the Years of Experience are recorded while the area of expertise is stored for the surgeon. • For every patient, the details such as a unique patient ID, name, and address are recorded. • A patient can make multiple appointments. For every appointment, a unique appointment ID, time, and reason is recorded. There are two types of appointments: Consultation and Surgery. Duration is stored for consultation while type is stored for surgery. • Surgery appointments are done by Surgeons while Consultation appointments are done by GPs. When a surgeon does the surgery appointment, a surgery note is recorded. • An invoice is created for every appointment. Details such as a unique invoice number, date, and amount are recorded for every invoice. • A single payment is made for every invoice. Split payments are not allowed. For every payment, a unique payment code, amount paid, and date of payment are stored in the databases. HOW MANY RELATIONSHIPS ARE THERE?
Give the definition of four classes, Person, Doctor, Patient and Billing, whose objects are records for a clinic. Class Doctor will be derived from the class Person. A doctor have it’s specialty and feesPatient will be derived from the class Person. A Patient record no_of_days_admitted and a Doctor object.A Billing object will contain a Patient object, Be sure your classes have a reasonable complement of constructors.First write a driver program to test all your member functions, and creates at least two patients, at least two doctors, and at least two Billing recordsAt the time of Billing the Patient’s Doctor name and Billing object’s doctor name equality should be checked.Total bill generated will be no of days the patient admitted * doctor's fees.
Details such as a unique ID, name, and address need to be stored for every doctor. There are two types of doctors: GPs and Surgeons. For a GP, the Years of Experience are recorded while the area of expertise is stored for the surgeon. • For every patient, the details such as a unique patient ID, name, and address are recorded. • A patient can make multiple appointments. For every appointment, a unique appointment ID, time, and reason is recorded. There are two types of appointments: Consultation and Surgery. Duration is stored for consultation while type is stored for surgery. • Surgery appointments are done by Surgeons while Consultation appointments are done by GPs. When a surgeon does the surgery appointment, a surgery note is recorded. • An invoice is created for every appointment. Details such as a unique invoice number, date, and amount are recorded for every invoice. • A single payment is made for every invoice. Split payments are not allowed. For every payment, a unique payment code, amount paid, and date of payment are stored in the databases.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.