dental patient appointment system

22
Dental Patient Appointment System Er diagrams with normalization upto 3rd NF 6/15/2015 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

Upload: sahar-sultan

Post on 11-Sep-2015

56 views

Category:

Documents


0 download

DESCRIPTION

Normalization and ER diagrams of Dental Patient Appointment System

TRANSCRIPT

Dental Patient Appointment System

Dental Patient Appointment SystemEr diagrams with normalization upto 3rd NF

6/15/2015

Group MembersAmmara Arooj 2013-ag-6230Faiza Ashfaq 2013-ag-542 Zunaira Sattar 2013-ag-1198Fareeha Nawaz 2013-ag-6265Javaria Kanwal 2013-ag-6094Sehar Sultan 2013-ag-6231

Dental Patient Appointment System

Table Attributes:Attribute NameDescription

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

ER Diagram of Dental Patient Appointment System

AddressTime-TOTime fromfrom-occupationDatep-Tele#BirthdayP-IDP-NameLastNamena

Marital Status

Get

idAppointmentPatient

IDCatagorySexhas

Price

SurgeryDisease

make

Belongid

catagory

Dentist

D-ID

d-NameTele#d-AddressTime-ToTimeFromEmailSeparate ER DiagramsRelationship 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

surgery

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

NormalizationNormalizationis 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 NormalizationWithout 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 RulesNormalization rule are divided into following normal form.1. First Normal Form2. Second Normal Form3. Third Normal Form4. 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 FormAs 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 uniqueIn 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

hasgetsProvides0,*10,*11111,*AppointmentSurgeryDentistDiseasePatient

O-ID(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 FormAs 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 failsSecond normal form.

3rd Normal FormThird Normal formapplies 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 thistransitive functional dependencyshould be removed from the table and also the table must be inSecond Normal form.

Normalization of tables

1stNFPATIENT table( P-ID, P-Name,P- Address, Sex,P- Telephone, P-Address,,Occupation,SurgeryID, Surgery Catagory, AppDate,AppTimefrom,AppTimeTo,DiseaseID,DiseaseCatagory )2ndNF

PATIENT table( P-ID, P-Name,P- Address, Sex,P- Telephone, P-Address,,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,d- Address,Email,TimeFrom,TimeTO,SurgeryID,SurgeryName,Surgery,Price)

2ndNFDOCTOR table( D-ID, d-Telphone,d- Name,d- Address,Email,TimeFrom,TimeTO )

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

3rd NF

Patient table( P-ID, P-Name,P- Address, Sex,P- Telephone, P-Address,,Occupation,SurgeryID)

FK

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

FK

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

Disease table(P-ID,DiseaseID,DiseaseCatagory )

FK

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