You are on page 1of 2

LINCOD, CHELLY ANDRIE B. Data Management in Cons.

(CEM04) HOMEWORK 2
CEIT-02-802E ENGR. ERNEL FILIPINAS

Doctors
Doctors_ID Doc_Name Doc_Phone Number Specialty Number Specialty
59674 Stephen Strange 9953978812 101 Pediatrics
59675 Robert Stark 9215467890 203 Clincal Pathology
59676 Shane Ross 9215678999 661 Anesthesiology
59677 Intern Piece 9677642342 155 Dermatology
59678 Bruce Banner 9092345661 611 Psychiatry

Patients
Patients_RegID P_Name P_Phone P_Email P_Address Date_Added Allergies Doctors_ID
3030222 Peter Parker 9217665019 spidey23@gmail.com 19 limjoco st. bagong ilog pasig city 03/02/2022 Pet allergy 59674
4021622 Tony Stark 9217665020 heyjarvis_44@gmail.com 22 jupiter st. sancarlos pangasinan 02/16/22 Food Allergy 59675
6031422 Ricky Martinez 9217665021 rickym16@gmail.com 1 mercado st. malate manila 03/14/22 None 59676
5040122 Christian Dior 9217665022 cdiorpogi@gmail.com 67 habangbuhay st. bgc makati 04/01/2022 Insect Allergy 59677
6040122 Lauren Phillips 9217665023 lphilips100@gmail.com 12 francisco st. bagong ilog pasig city 04/02/2022 None 59678

Appointments
Appointment_ID Apppointment_Date Patients_RegID Blood_Pressure Heart Rate Treatment_Notes Medicines Doctors_ID
B13030222 03/05/2022 3030222 120/80 160bpm drink 8 glasses of water a day Loratadine (Alavert, Claritin) 59674
B24021622 02/17/22 4021622 122/80 162bpm avoid the foods that trigger a reaction. Antihistamines 59675
B36031422 03/29/22 6031422 115/70 120bpm maintain a healthy diet paracetamol 59676
B45040122 04/06/2022 5040122 118/75 190 bpm avoid too much caffeine fexofenadine 59677
B56040122 04/07/2022 6040122 117/81 192bpm have a sleep of 8-10hrs a day zanamivir (trade name Relenza) 59678
LINCOD, CHELLY ANDRIE B. Data Management in Cons. (CEM04) HOMEWORK 2
CEIT-02-802E ENGR. ERNEL FILIPINAS

Notes:

Each relation has unique identifier and it is labeled as PK (Primary Key)


Degree of each relation (It is the number of attributes in a relation schema)
1. Doctor: Doctors_ID, Doc_Name, Doc_Phone Number, Specialty Number, Specialty.
So, in this 1st relation the degree is 5
2. Patient: Patients_RegID, P_Name, P_Phone, P_Email, P_Address, Date_Added, Allergies,
Doctors_ID
So, in this 2nd relation the degree is 8
3. Appointment: Appointment_ID, Apppointment_Date, Patients_RegID, Blood_Pressure, Heart
Rate, Treatment_Notes, Medicines, Doctors_ID
So, in this 3rd relation the degree is 8

A. Entity Integrity Constraints: “No primary key value can be null”


As you can see no primary value are null in every relation presented above

B. Referential Integrity Constraints: “States that a tuple in one relation that refers to another relation
must refer to an existing tuple in that relation”
As you can see in each of relation presented above there is an FK that means foreign key and that foreign
key refers to an existing tuple. For example the Doctors_ID in the Patient table refers to the Doctors_ID
in the Doctors table and it is labeled as FK in Patients table because it refers to the PK (Primary key) in
the Doctors Table.

C. Semantic Integrity Constraints: “Semantic integrity constraints are used to help ensure that a
database accurately reflects the real world in structure and content.”

D. Domain Constraints: “Domain constraints can be defined as the definition of a valid set of values for
an attribute”
Every data type inserted in every relation presented above do follows certain data type needed. For
example the data type of Doctors ID are in Integers meaning all inputs are in integers and it does not
have “string” or even “characters”, integers only.

E. Null constraints: “NOT NULL constraint makes sure that a column does not hold NULL value."
There are no NULL values on every relation presented above.

F. Unique Constraints: “The UNIQUE constraint ensures that all values in a column are different.”
Every entity that we have has an Unique value or what we called Primary Key. In the Doctors Table we
have Doctors ID as the Primary key, same goes for the Patients Registration ID and Application ID as the
Primary key in the Patients Table and Appointments Table

You might also like