Programming Assignment Unit 1 Solution
Programming Assignment Unit 1 Solution
Name Text Note that Name refers to name and surname of the doctor.
This is a design choice. Alternatively, there can be two
attributes as Name and Surname.
Null constraint: Every doctor has a phone number.
Patient Relation
This uniquely identifies Patient relation.
PatientID Number Null constraint, Entity integrity constraint, Unique constraint:
This is the primary key of Patient relation.
Null constraint: Every patient has a name.
Name Text Note that Name refers to name and surname of the patient.
This is a design choice. Alternatively, there can be two
attributes as Name and Surname.
Null constraint: Every patient has a phone number.
Phone Number Semantic integrity constraint: The phone number has a
specific format that should be validated (This is not required
in your peers’ assignment).
It is possible that patient doesn’t have an e-mail address.
Email Text Semantic integrity constraint: E-mail has a specific format
that should be validated (This is not required in your peers’
assignment).
Address Text Null constraint: Every patient has an address.
Null constraint: This is the registration date of patient to
hospital. Every patient should have a registration date.
AddedDate Date
Semantic integrity constraint: Date has a specific format that
should be validated (This is not required in your peers’
assignment).
Allergies Text Patient may not have any allergies.
Null constraint: Each patient is admitted by one doctor
DoctorID Number Referential integrity constraint: DoctorID is a foreign key to
the Doctor relation.
Appointment Relation
This uniquely identifies Appointment relation.
AppointmentID Number Null constraint, Entity integrity constraint, Unique constraint:
This is the primary key of Appointment relation.
Null constraint: There should be a doctor for each
appointment.
DoctorID Number
Referential integrity constraint: DoctorID is a foreign key to
the Doctor relation.
Null constraint: There should be a patient for each
appointment.
PatientID Number
Referential integrity constraint: PatientID is a foreign key to
the Patient relation.
Null constraint: This is the registration date of patient to
hospital. Every patient should have a registration date.
AppointmentDate Date Semantic integrity constraint: Date has a specific format that
should be validated (This is not required in your peers’
assignment).
BloodPressure Number Null constraint: During each appointment, blood pressure of
the patient is stored.
Weight Number Null constraint: During each appointment, weight of the
patient is stored.
TreatmentNotes Text Null constraint: During each appointment, doctor writes
about treatment of patient.
Medicines Text During appointment doctor may or may not prescribe
medicine/s
Degree of relation : 8