Sei sulla pagina 1di 19

Dental Patient

Appointment System
Er diagrams with normalization upto 3rd NF

Group Members

Ammara Arooj 2013-ag-6230

Faiza Ashfaq 2013-ag-542

Zunaira Sattar 2013-ag-1198

Fareeha Nawaz 2013-ag-6265

Javaria Kanwal 2013-ag-6094

Sehar Sultan

2013-ag-6231

Dental Patient Appointment System

Table Attributes:
Attribute Name
Patient-ID
P-Name
p-LastName
Birthday
Birthplace
p-Address
p-HomeTelephone
p-Marital Status
p-Mobile
p-Occupation
p-Sex
Dentist-Name
d-Telephone
d-Email
TimeFrom
TimeTo
d-Address
Dentist-ID
SurgeryName
Material
O-Price
Surgery-ID
Disease-ID
Disease-Category
App-Date
App-TimeFrom
App-TimeTo
StaffNo

Description

ER Diagram of Dental Patient Appointment


System

Time from
P-ID

P-Name

LastName

Birthday

Address
occupation

p-Tele#

Date
TimeTO

Marital
Status

Get

Patient

Appointme
nt

id

Sex

has

Price

Disease

Catagory

ID

Surgery

make

Belong
id
catagory

Dentist

D-ID
d-Name
Tele#

d-Address

Time-To

TimeFrom

Email

Separate ER Diagrams
Relationship between Patient Entity and Dentist Entity

Relationship between Patient Entity and Appointment Entity

Relationship between Patient Entity and Disease Entity

Relationship between Dentist Entity and Operation Entity

surge
ry

Relationship between Patient and Dentist

Relationship between Patient and Appointment

Relationship between Patient and Operation

Relationship between Dentist and Operation

Relationship between Patient and Disease

Normalization
Normalization is the process of organizing data in a database. This includes creating tables and
establishing relationships between those tables according to rules designed both to protect the
data and to make the database more flexible by eliminating redundancy and inconsistent
dependency.
Normalization is used for mainly two purposes,

Eliminating redundant (useless) data.

Ensuring data dependencies make sense i.e. data is logically stored.

Problems in data without Normalization


Without Normalization, it becomes difficult to handle and update the database, without facing
data loss. Insertion, Updating and Deletion Anomalies are very frequent if Database is not
Normalized.

Normalization Rules
Normalization rule are divided into following normal form.
1.

First Normal Form

2.

Second Normal Form

3.

Third Normal Form

4.

BCNF

The above table is not well structured, un-normalized containing redundant data. By using a
bottom-up approach we analyzing the given table for anomalies. First observation, we
seemultiple values in an appointment column and this of course violates the 1NF. By assuming
the staffNo and patientNo as candidate keys, there are many anomalies exist.
Insertion anomalies:
To insert a new patient particular that makes an appointment with the designated Doctor, we need
to enter the correct detail for the staff. For example, to insert the details of new patient in
patientNo, patientName and an appointment, we must enter the correct details of the doctor
( dentistName) so that the patient details are consistent with values for the designated Doctor. To
enter new patient data that doesnt have Doctor to be assigned we cant insert NULL values for
the primary key.
Deletion anomalies:
If we want to delete a patient, two records need to be deleted. This anomaly also obvious when
we want to delete the dentistName, multiple records needs to be deleted to maintain the data
integrity. When we delete a Dentist record the details about his patients also lost from the
database.
Modification anomalies:
With redundant data, when we want to change the value of one columns of a particular Dentist,
for example the dentistName, we must update all the Dentist records that assigned to the
particular patient otherwise the database will become inconsistent. We also need to modify the
appointment schedules because different Dentist has different schedules.
1st Normalization Form
As per First Normal Form, no two Rows of data must contain repeating group of information i.e
each set of column must have a unique value, such that multiple columns cannot be used to fetch
the same row. Each table should be organized into rows, and each row should have a primary key
that distinguishes it as unique
In the 1NF we remove all the repeating groups (appointment), assigning new column (apptDate
and apptTime) and assigned primary keys (candidate keys). Then we figure out the functional

dependencies (FDs). By using dependency diagram we represent the table as shown below. (NF
stand for Normal Form); e.g,

Class Diagram of Dental Patient Appointment


System

Patient

Disease
has
1

1,*

1
1
gets
Appointment

0,*

Surgery

Dentist
1
Provides
1

0,*

OID

(FD=Functional Dependency)
(NF=Normal Form)
In this case, we can see that FD2 (just depend on staffNo) and FD4 (just depend on staffNo and
apptDate) violate the 2NF. These two NFs are partially dependent on the candidate keys not the
whole keys. FD2 can stand on its own by depending on the O-ID and meanwhile FD4 also can
stand on its own by depending on the O-ID.
2nd Normal Form
As per the Second Normal Form there must not be any partial dependency of any column on
primary key. It means that for a table that has concatenated primary key, each column in the table
that is not part of the primary key must depend upon the entire concatenated key for its existence.

If any column depends only on one part of the concatenated key, then the table fails Second
normal form.

3rd Normal Form


Third Normal form applies that every non-prime attribute of table must be dependent on primary
key, or we can say that, there should not be the case that a non-prime attribute is determined by
another non-prime attribute. So this transitive functional dependency should be removed from
the table and also the table must be in Second Normal form.

Normalization of tables
1stNF

PATIENT table
( P-ID, P-Name,P- Address, Sex,P- Telephone, PAddress,,Occupation,SurgeryID, Surgery Catagory,
AppDate,AppTimefrom,AppTimeTo,DiseaseID,DiseaseCatagor
y)

2ndNF

PATIENT table
( P-ID, P-Name,P- Address, Sex,P- Telephone, PAddress,,Occupation)

Surgery table
(SurgeryID, Surgery Catagory,
AppDate,AppTimefrom,AppTimeTo,P-ID)

Disease table
(P-ID,DiseaseID,DiseaseCatagory )

1stNF
DOCTOR table
( D-ID, d-Telphone,d- Name,dAddress,Email,TimeFrom,TimeTO,SurgeryID,SurgeryName,Sur
gery,Price)

2ndNF
DOCTOR table

( D-ID, d-Telphone,d- Name,dAddress,Email,TimeFrom,TimeTO )

Surgery table
(D-ID,SurgeryID,SurgeryName,Surgery,Price)

3rd NF
Patient table
( P-ID, P-Name,P- Address, Sex,P- Telephone, PAddress,,Occupation,SurgeryID)
FK

Surgery table
(SurgeryID,SurgeryName,Surgery,Price,D-ID)
FK

Doctor table
( D-ID, d-Telphone,d- Name,dAddress,Email,TimeFrom,TimeTO )

Disease table
(P-ID,DiseaseID,DiseaseCatagory )
FK

Appointment table
(P-ID,App-Day,AppTimeFrom,AppTimeTo)

Potrebbero piacerti anche