veterinary surgery database development
TRANSCRIPT
-
8/7/2019 Veterinary Surgery Database Development
1/16
i
Veterinary Surgery Database
Development
October, 2010
M. D. Shirima
-
8/7/2019 Veterinary Surgery Database Development
2/16
ii
TABLE OF CONTENTS
TASK 1 ........................................................................................................... 1ENTITY RELATIONSHIP DIAGRAM ............................................................... 1RELATIONSHIP ............................................................................................. 1TASK 2 ........................................................................................................... 2NORMALIZED TABLES WITH CLEARLY INDICATION OF PRIMARY AND
FOREIGN KEYS .............................................................................................. 2FIRST NORMAL FORM ................................................................................... 3SECOND NORMAL FORM ............................................................................... 4THIRD NORMAL FORM .................................................................................. 5TASK 3 ........................................................................................................... 6NORMALIZED TABLES SET UP IN ACCESS DATABASE MANAGEMENT
SYSTEM ......................................................................................................... 6TASK 4 ......................................................................................................... 11STRUCTURED QUERY LANGUAGE (SQL) ..................................................... 11TASK 5 ......................................................................................................... 13
ASSUMPTIONS ............................................................................................ 13REFERENCE ................................................................................................. 14
-
8/7/2019 Veterinary Surgery Database Development
3/16
1
TASK 1
ENTITY RELATIONSHIP DIAGRAM
RELATIONSHIP
This is a connection between entities. There are two rules needed when you want
to add relationship. These rules can be referred as cardinalityand participation.
Breeds
OwnerContacts
Animal Type
Branch
Prescription
Diagnosis Charges
AppointmentVeterinary
Contacts
-
8/7/2019 Veterinary Surgery Database Development
4/16
2
TASK 2
NORMALIZED TABLES WITH CLEARLY INDICATION OF PRIMARY AND
FOREIGN KEYS
UN-NORMALIZED DATA-SET
Data which are not normalized.
VETERINARYINFO
VetDrNo
VetDrName
VetDrAddress
VetDrHomTel
VetDrMobTel
BranchIDBranchName
BranchAddress
BranchTel
BranchOpnHrs
BranchEmergenceContact
AnimalID
AnimalName
AnimalAge
OwnerName
OwnerHomTel
OwnerMobTel
OwnerAddress
(AppointmentNo
AppointmentTime
AppointmentDate
DrugName
DrugType
DrugPeriod
AnimalTypeNoAnimalTypeName
BreedTypeNo
BreedTypeName
VetSpecNo
VetSpecName
PrescriptionName
PrescriptionPeriod )
CostID
DrugCost
AppointmentCost
RepeatingGroup
-
8/7/2019 Veterinary Surgery Database Development
5/16
3
FIRST NORMAL FORM
First Normal Form involves to get rid of repeating groups of data.
First Normal Form
VETERINARYINFOVetDrNo
VetDrName
VetDrAddress
VetDrHomTel
VetDrMobTel
BranchID
BranchName
BranchAddress
BranchTel
BranchOpnHrs
BranchEmergenceContact
AnimalID
AnimalName
AnimalAge
OwnerName
OwnerHomTel
OwnerMobTel
OwnerAddress
CostID
DrugCost
AppointmentCost
APPOINTMENTINFOVetDrNo*
AppointmentNo
AppointmentTime
AppointmentDate
DrugName
DrugType
DrugPeriod
AnimalTypeNo
AnimalTypeName
BreedTypeNo
BreedTypeName
VetSpecNo
VetSpecName
PrescriptionName
PrescriptionPeriod
-
8/7/2019 Veterinary Surgery Database Development
6/16
4
SECOND NORMAL FORM
Second Normal Form is working with relation which was in First Normal Form its
affects only relations with more than one attribute in the key.
Second Normal FormVETERINARYINFO
VetDrNo
VetDrName
VetDrAddress
VetDrHomTel
VetDrMobTel
BranchID
BranchName
BranchAddress
BranchTel
BranchOpnHrs
BranchEmergenceContact
AnimalID
AnimalName
AnimalAge
OwnerName
OwnerHomTel
OwnerMobTel
OwnerAddressCostID
DrugCost
AppointmentCost
APPOINTMENTINFO
VetDrNo*
AppointmentNo
AppointmentTime
AppointmentDate
DRUGDETAILS
DrugName
DrugType
DrugPeriod
ANIMALTYPEINFO
AnimalTypeNo
AnimalTypeName
BREEDINFO
BreedTypeNo
BreedTypeName
SPECIALIZATIONINFO
AnimalTypeNo*
VetSpecNo
VetSpecName
PRESCRIPTIONINFO
PrescriptionName
PrescriptionPeriod
-
8/7/2019 Veterinary Surgery Database Development
7/16
5
THIRD NORMAL FORM
Third Normal Form is carry out for relations which is previously in second normal
form and considers dependencies among non-key.
Third Normal FormVETERINARYINFO
BranchID*
AppointmentNo*
PrescriptionName*
VetSpecNo*
VetDrNo
VetDrName
VetDrAddress
VetDrHomTel
VetDrMobTel
BRANCHINFO
BranchID
BranchName
BranchAddress
BranchTel
BranchOpnHrs
BranchEmergenceContact
ANIMAILINFO
AnimalTypeNo*
BreedTypeNo*
AnimalID
AnimalName
AnimalAge
OWNERINFO
AppointmentNo*
AnimalID*
OwnerName
OwnerHomTel
OwnerMobTel
OwnerAddress
COSTINFO
CostID
DrugCost
AppointmentCost
APPOINTMENTINFO
VetDrNo*
CostID*
AppointmentNo
AppointmentTime
AppointmentDate
DRUGDETAILS
CostID*
DrugNameDrugType
DrugPeriod
ANIMALTYPEINFO
AnimalTypeNo
AnimalTypeName
BREEDINFO
BreedTypeNo
BreedTypeName
SPECIALIZATIONINFO
AnimalTypeNo*
VetSpecNo
VetSpecName
PRESCRIPTIONINFO
PrescriptionName
PrescriptionPeriod
-
8/7/2019 Veterinary Surgery Database Development
8/16
6
TASK 3
NORMALIZED TABLES SET UP IN ACCESS DATABASE MANAGEMENT
SYSTEM
The following below figure 1 to figure 10 are tables for Petcare database.
Figure 1
Figure 2
-
8/7/2019 Veterinary Surgery Database Development
9/16
7
Figure 3
Figure 4
-
8/7/2019 Veterinary Surgery Database Development
10/16
8
Figure 5
Figure 6
-
8/7/2019 Veterinary Surgery Database Development
11/16
9
Figure 7
Figure 8
Figure 9
-
8/7/2019 Veterinary Surgery Database Development
12/16
10
Figure 10
DATABASE RELATIONSHIP
-
8/7/2019 Veterinary Surgery Database Development
13/16
11
TASK 4
STRUCTURED QUERY LANGUAGE (SQL)
SQL is a standard database sublanguage for relation database, management
systems.
This query displays the show branches name and branch address, veterinary doctors
name and their specialism(s).
SELECT BranchName, BranchAddress, VetDocName, VetSpecName
FROM BranchInfo, VeterinaryInfo, SpecializationInfo
WHERE BranchInfo.BranchID=VeterinaryInfo.BranchID
AND VeterinaryInfo.VetSpecNo=SpecializationInfo.VetSpecNo
After run the query above the output produced is as shown below.
The Output of Query
-
8/7/2019 Veterinary Surgery Database Development
14/16
12
This query displays the all appointment of the Petcare which shows the branch
name, veterinary doctor, appointment date and time, animal name, animal type and
breed of animal which appointment made for.
SELECT BranchName, VetDocName, AnimalName, AnimalTypeName,
BreedTypeName, AppointmentDate, AppointmentTime
FROM BranchInfo, VeterinaryInfo, AnimalInfo, AnimalTypeInfo,
BreedInfo, AppointmentInfo
WHERE BranchInfo.BranchID=VeterinaryInfo.BranchID
AND AnimalInfo.AnimalTypeNo=AnimalTypeInfo.AnimalTypeNo
AND AnimalInfo.BreedTypeNo=BreedInfo.BreedTypeNo
AND
AppointmentInfo.AppointmentNo=VeterinaryInfo.AppointmentNo
ORDER BY AppointmentInfo.AppointmentDate;
The Output of Query
-
8/7/2019 Veterinary Surgery Database Development
15/16
13
TASK 5
ASSUMPTIONS
The Petcare organization database had been created through Microsoft Access all
tables have been analyzed and created to meet the purpose required for the
database and the assumptions made that for each table primary key have been
identified by entities ID, also the cost table will act as cost center for appointment
charges which we assume will be fixed price and drug charges which will be
identified by CostID as per task three shows the well-designed data printouts.
The implementation of the Petcare organization database was successful and
performance of the database meets the requirement and rules its easy to update,
delete, and add data in the database.
-
8/7/2019 Veterinary Surgery Database Development
16/16
14
REFERENCE
1. NCC Database Development and Design (IADCS) 2008; ISBN 0954307101