Google Answers Logo
View Question
 
Q: Database Management System 'Normalisation problem ( Answered 5 out of 5 stars,   1 Comment )
Question  
Subject: Database Management System 'Normalisation problem
Category: Computers > Programming
Asked by: purplepit-ga
List Price: $50.00
Posted: 16 Nov 2003 09:43 PST
Expires: 16 Dec 2003 09:43 PST
Question ID: 276439
Hi there, Can you possibly answer the questions below, relating to the
Tables listed......
QUESTION

If the data in each Table is implemented as a single table,
provide examples of update anomalies (insertion, deletion and modification)
that can be caused by the data redundancy.
Normalise to Third Normal Form (3NF) the data in Figures 1, 2 and 3
(separately). Show the state of the relations in each normal form.
Merge all three sets of 3NF relations to produce a set of Rationalised 3NF
relations.
Clearly state any assumptions made.

--------------------------------------------------------------------------
Hospital
Patient REGISTRATION FORM

Patient No 353445

Personal details

First name...Anne
Last name?....Phelps
Address....44 North Road, Camberley
Tel No....02089235331
Dob.....12 Dec 33
Marital status..Single
Date registered..21 Feb 95

Local Doctor GP Details

Full name  Dr Helen Pearson
Address..22 South Road Canberley
Tel no..02082653621
Clinic No..E102

-------------------------------------------------

 Hospital 
 Patient MEDICATION FORM

Patient Number...P10034
Full Name...Robert McDonald
Ward number...11
Bed Number...84
Ward Name...Orthopaedic

Drug     Name    Description   Dosage   Method of   Units per  Start  Finish
Number                                  Admin       Day        Date   Date

10223   Morphine   Pain Kiler  10mg/ml   Oral      50      24.3.98    24.4.98 

10334 Tetracycline Antibiotic 0.5mg/ml  IV       10     24.3.98  24.4.98       

10223   Morphine   Pain Kiler 10mg/ml   Oral     10     25.4.98    2.5.98

--------------------------------------------------------------------------

Hospital 
STAFF FORM
        
Personal details

First name..Moira
Last name?..  Samuel
Address...49 Philippa Gardens
Tel...02089968675
Dob...30.5.61
Sex...Female
Position...Charge Nurse
NIN....WB1234234D
Allocated to Ward..11

Qualifications
  

Type...........BSC Nursing
Date..........12.8.87
Institution....Edinburgh University.
Answer  
Subject: Re: Database Management System 'Normalisation problem
Answered By: answerguru-ga on 16 Nov 2003 13:23 PST
Rated:5 out of 5 stars
 
Hi purplepit-ga,

Normalizing databases is very important for space and efficiency
reasons, and especially so when they become very large. Below are the
answers to the questions you have posed:

SINGLE TABLE UPDATE ANOMALIES:

Assume single table in this case consists of the following fields:
 
PatientNo
PatientFirstName
PatientLastName
PatientAddress
PatientTelNo
PatientDob 
PatientMaritalStatus
PatientDateRegistered
DoctorFullName
DoctorAddress
DoctorTelNo
ClinicNo 
PatientFullName
WardNo
BedNo
WardName
DrugName
DrugDescription
DrugDosage
DrugAdmin
DrugUnitsPerDay
DrugStartDate
DrugEndDate
StaffFirstName
StaffLastName
StaffAddress
StaffTel
StaffDob
StaffSex
StaffPosition
StaffNIN
StaffAllocatedToWard 
StaffQualificationType
StaffQualificationDate
StaffQualificationInstitution

This implementation can cause many problems with insertion, deletion,
and modification:

Insertion:

Recording one piece of information, for example a new drug
prescription for a patient requires re-entry of all patient
information, doctor information, hospital-related information, drug
information, general staff information, and even staff qualification
information! Clearly, the only information required would be those
identifying the patient, doctor, drug, staff member. THis can not only
drastically increase the amount of time to complete one record (as a
result of having to find out unnecessary information) but can also
lead to inconsistencies in the data (typos, capitalization issues,
etc.).

Modification:

In order to modify a specific piece of information, such as a
patient's home address, will require making a change to every record
(corresponding to a visit) a patient has made. An even worse case
would be when a piece of data pertaining to a staff member needs to be
updated (such as a nurse who has finished a university degree part
time and has now become a doctor, or a doctor who has moved). In these
cases, every record where that staff member has interacted with a
patient needs to be updated with the new information. For a staff
member who has been working there for just a couple years, this could
mean thousands of record updates!

Deletion:

Deletion is similar to modification, however instead of changing a
piece of information, it is simply being removed altogether. Consider
a patient who has been refused service for some reason (ie. they were
stealing medical supplies when coming to the hospital) - the hospital
has no need for the previous records of this person. Rather than just
deleting patient related information, the length of the record to be
deleted includes far more data that has very little to do with the
patient (such as the qualifications of a staff member). All this sort
of information also must be deleted.


NORMALIZATION TO 3NF:

First, let's define what Third Normal Form actually requires:

1. Meet the requirements of 1NF and 2NF
2. Remove columns that are not fully dependent upon the primary key

1NF requirements: 
No duplicative columns
Primary key required

2NF requirements:
No subsets of data can apply to multiple rows

http://databases.about.com/library/weekly/aa091601a.htm

Here are the tables that conform to the 3NF requirements:

**Note: tables with multiple "(primary)" indicators mean that these
fields combine to form a primary key
Patient
	PatientNo	(primary)
	PatientFirstName
	PatientLastName
	PatientAddress
	PatientTelNo
	PatientDob 
	PatientMaritalStatus
	PatientDateRegistered

PatientAdmission
	PatientNo (primary)
	ClinicNo (primary), (foreign)
	WardNo (primary), (foreign)
	BedNo (primary)
	DateAdmitted
	DateReleased

Wards
	WardNo
	WardName

Clinic
	ClinicNo
	ClinicName

Drug
	DrugName (primary)
	DrugDescription
	DrugDosage
	DrugAdmin
	DrugUnitsPerDay

DrugPrescription
	DrugName (primary), (foreign)
	PatientNo (primary), (foreign)
	StaffFullName (primary), (foreign)
	DrugStartDate
	DrugEndDate

Staff
	StaffFullName (primary)
	StaffAddress
	StaffTel
	StaffDob
	StaffSex
	StaffPosition
	StaffNIN
	StaffAllocatedToWard (foreign)

StaffQualification
	StaffFullName (primary), (foreign)
	StaffQualificationType
	StaffQualificationDate (primary)
	StaffQualificationInstitution

Assumptions of above normalization:

1. Patients are assigned a unique number upon their first visit to one
of the clinics
2. Upon admission, patients are assigned to a bed located in a ward,
which is within a clinic
3. Clinics and wards are uniquely identified by their ClinicNo and
WardNo respectively (even though there may be a ward of the same name
in different clinics)
4. Drug names are unique identifiers
5. Drug dosage, administration method, and units are standard for all patients
6. Staff are uniquely identified by their full names
7. Staff are allocated to the exactly one ward
8. Staff complete at most one qualification on a specific date
9. 


Hopefully that gives you an understanding of how to convert a
non-normalized databased into one which follows the requirements of
3NF. Please let me know if you are having problems understanding the
above information :)

Cheers!

answerguru-ga

Request for Answer Clarification by purplepit-ga on 17 Nov 2003 04:59 PST
Hi
Thanks for your answer so far.However, I'm still un-sure about the
normalisation section!!!!!
Can you please put this info into proper tables as per the question
for clarification purposes, If so I will give you a very generous
TIP!!!!!!
Purplepit-ga

Clarification of Answer by answerguru-ga on 17 Nov 2003 07:09 PST
Hi again purplepit-ga,

I have already listed the tables in this format (with the field names indented):

TableName
 Field1
 Field2

These are the normalized forms (3NF) of the tables that you need. I am
reposting them here:

Patient 
 PatientNo (primary) 
 PatientFirstName 
 PatientLastName 
 PatientAddress 
 PatientTelNo 
 PatientDob  
 PatientMaritalStatus 
 PatientDateRegistered 
 
PatientAdmission 
 PatientNo (primary) 
 ClinicNo (primary), (foreign) 
 WardNo (primary), (foreign) 
 BedNo (primary) 
 DateAdmitted 
 DateReleased 
 
Wards 
 WardNo 
 WardName 
 
Clinic 
 ClinicNo 
 ClinicName 
 
Drug 
 DrugName (primary) 
 DrugDescription 
 DrugDosage 
 DrugAdmin 
 DrugUnitsPerDay 
 
DrugPrescription 
 DrugName (primary), (foreign) 
 PatientNo (primary), (foreign) 
 StaffFullName (primary), (foreign) 
 DrugStartDate 
 DrugEndDate 
 
Staff 
 StaffFullName (primary) 
 StaffAddress 
 StaffTel 
 StaffDob 
 StaffSex 
 StaffPosition 
 StaffNIN 
 StaffAllocatedToWard (foreign) 
 
StaffQualification 
 StaffFullName (primary), (foreign) 
 StaffQualificationType 
 StaffQualificationDate (primary) 
 StaffQualificationInstitution

Hopefully that clears things up :)

answerguru-ga
purplepit-ga rated this answer:5 out of 5 stars and gave an additional tip of: $10.00
Excellent as ever!!!!!

Comments  
Subject: Re: Database Management System 'Normalisation problem
From: answerguru-ga on 17 Nov 2003 22:21 PST
 
Hi purplepit-ga,

Thanks for the great rating, kind words, and generous tip! Hoep to see
you again soon :)

answerguru-ga

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy