Database
Database
Student Declaration
Candidate Name:
Candidate ID Number:
Qualification: BITL5
Unit: DBDD
Centre: LILONGWE
I have read and understood both NCC Education’s Academic Misconduct Policy and the
Referencing and Bibliographies document. To the best of my knowledge my work has been
accurately referenced and all sources cited correctly.
I confirm that this is my own work and that I have not colluded or plagiarized any part of it.
Candidate Signature: YK
Page 1 of 39
Statement and Confirmation of Own Work
Table of Contents
Task 1: Description of Business....................................................................................................................3
Task 2 Entity Relationship Modelling...........................................................................................................4
Data dictionary............................................................................................................................................4
Task 3 Normalisation...................................................................................................................................6
The Purpose of Normalization and Why Each Entity is in 3NF...........................................................6
How normalization used to check tables............................................................................................6
Task 4 Assessment of Design.......................................................................................................................7
Task 5 creating table structures...................................................................................................................8
Task 6 Data population..............................................................................................................................17
.................................................................................................................................................................. 24
Task 7 SQL REPORT....................................................................................................................................26
Task 8: Distributed Database.....................................................................................................................34
Task 9 Gibbs reflective cycle (1988) model................................................................................................35
References.................................................................................................................................................36
Page 2 of 39
Statement and Confirmation of Own Work
INTRODUCTION
This report will examine some of the aspect of business of Good Hope private clinic how its database
worked on keeping records for the department looking of the treatment of the patient.
Page 3 of 39
Statement and Confirmation of Own Work
Every Patient can be served by one or more Doctors and some way as patient can get treatment form
one or more diseases according to the diagnosis that the Doctor sees. Every Doctor is allocated to
department and how to treat the patient is based on the Disease category and the appointment
description, at good hope they currently provide maternal health, family planning, hospital transition
care etc.
Page 4 of 39
Statement and Confirmation of Own Work
Data dictionary
Entity Attribute Data type Length Constraints
Room type Room type ID Integer 11 Primary Key
Room type Varchar 255
Room Room ID INT 11 PK
Room Number varchar 255
Room type ID INT FK
Visitor Visitor ID Integer 11 Primary Key
Visitor Name Varchar 255
Visitor phone number Varchar 10
Address Varchar 255
Visit Visit ID INT 11 PK
Date DATE
Time VARCHAR 255
Page 5 of 39
Statement and Confirmation of Own Work
Admission ID INT 11 FK
Visitor ID INT 11 FK
Disease Category Disease Category ID Int 11 Primary Key
Disease Category Varchar 255
Page 6 of 39
Statement and Confirmation of Own Work
Task 3 Normalisation
The Purpose of Normalization and Why Each Entity is in 3NF
The main purpose of normalization is to overcome the potential anomalies that occurs when
data is replicated. Therefore, it is there to eliminate replication.
hence it makes the tables inconsistent state for example in doctors table suppose we had doctor
”Dr Elizabeth” who belongs to that table if we want to update that name to doctor we need to update
the doctor table. The same rule applies as before i.e. the table has to be in 2NF before proceeding to
3NF. The other condition is there should be no transitive dependency for non-prime attributes. That
means non-prime attributes (which doesn’t form a candidate key) should not be dependent on other
non-prime attributes in a given table. Patient ID determines appointment ID, and appointment
ID determines appointment. Therefore, patient ID determines appointment via appointment ID. This
implies that we have a transitive functional dependency, and this structure does not satisfy the third
normal form.
As well as the details for appointment this include appointment number, appointment type,
appointment date, check in Date admission, Payment Method, room type and Room Number.
After normalisation was done, we came up with appointment table, Payment method, room
type and room. So to go through how normalisation has solved the problem of update
anomalies we are going to use the data of Room type in relation to appointment. In this case, if
one wants to change the appointment to meet the doctor that person needs to go do it for
every tuple where someone reserved for that particular doctor and update the appointment of
that doctor on duty. For example, a patient appointment type cost 35 000.00 therefore, it can
be change which will require that particular person to update the record on each and every
tuple to update the appointment type payment.
Page 7 of 39
Statement and Confirmation of Own Work
Task 4 Assessment of Design
According to the scenario given, the client of good hope would like to have a database system
so that they can keep on track of appointment and to reduce the pressure on reception staff.
Therefore, the system been developed would be required to store medical scheme
information, patient information, details of any activity in terms of the dates, time on which
the activities occurred, the time and the payment for the admission treatment. In addition,
the system would also be required to store appointment and receipt document.
In terms of how the Initial design to satisfied the requirements, after successfully normalizing
the given data, six entities were determined namely: admission, disease, category, visitor,
visit, appointment description and which held the information for the appointment activity,
Prescription and payment. The attribute of prescription Code was introduced in the
prescription entity as a Primary key.
After determining the entities and attributes, we moved on to the implementation phase
whereby some entities where moved to other tables which where populated with data. The
tables for the entities were successfully done in Task 3, the tables were populated with the
required documents. The visitors table was used to perform the query which required the
details of the patient admitted in alphabetical order of first name and surname as well as age.
The bookings table was used for performing the query which required all visited to be
displayed by the activity date in ascending order. Finally, all the requirements of Good Hope
Clinic were successfully satisfied and the system was successfully implemented.
Page 8 of 39
Statement and Confirmation of Own Work
Task 5 creating table structures
1. create table Room Type
Page 9 of 39
Statement and Confirmation of Own Work
Page 10 of 39
Statement and Confirmation of Own Work
Page 11 of 39
Statement and Confirmation of Own Work
Page 12 of 39
Statement and Confirmation of Own Work
7. create table appointment
Page 13 of 39
Statement and Confirmation of Own Work
Page 14 of 39
Statement and Confirmation of Own Work
Page 15 of 39
Statement and Confirmation of Own Work
Page 16 of 39
Statement and Confirmation of Own Work
Below shows the result of created of appointment description
Page 17 of 39
Statement and Confirmation of Own Work
Page 18 of 39
Statement and Confirmation of Own Work
Task 6 Data population
This task is there to show date insertion in the created tables
Page 19 of 39
Statement and Confirmation of Own Work
Page 20 of 39
Statement and Confirmation of Own Work
Page 21 of 39
Statement and Confirmation of Own Work
Page 22 of 39
Statement and Confirmation of Own Work
Page 23 of 39
Statement and Confirmation of Own Work
Page 24 of 39
Statement and Confirmation of Own Work
Page 25 of 39
Statement and Confirmation of Own Work
Page 26 of 39
Statement and Confirmation of Own Work
Page 27 of 39
Statement and Confirmation of Own Work
1. Below is a script for a newly added column given a constraint name appointment payment
Page 28 of 39
Statement and Confirmation of Own Work
2. Below is a script query that gives appointment number for each doctor
Page 29 of 39
Statement and Confirmation of Own Work
Page 30 of 39
Statement and Confirmation of Own Work
Page 31 of 39
Statement and Confirmation of Own Work
Page 32 of 39
Statement and Confirmation of Own Work
Page 33 of 39
Statement and Confirmation of Own Work
Below is the result of the script selected for visitor using “and” clause
Page 34 of 39
Statement and Confirmation of Own Work
8. Below is a script showing the query of selecting of disease category using ”as”
Page 35 of 39
Statement and Confirmation of Own Work
Page 36 of 39
Statement and Confirmation of Own Work
Below is the result of the script selected
Making Data Available Across an Organisation any successful organization needs to expand its
network hardware and software, which reside every work device that allows every site to
interact and exchange data on its multiple platform. It is likely that new sites can develop within
and outside the organization, therefore with the extend of the new site there is a need for
distributed database so that data should be distributed accordingly across many sites in the
organisation.
Data Backup One of the most common technique in distributed database is replication of data
across different sites. This replication of data it automatically helps recovery if the database in
any other site is damaged, allowing users to access data from other site while it is being
reconstructed.
Page 37 of 39
Statement and Confirmation of Own Work
one than this could also increase performance as it removes the need to sort through lots of rows that
are not relevant to the local site.
Availability Locally data is less likely to have access disrupted by network problems with the
central system.
Page 38 of 39
Statement and Confirmation of Own Work
References
Anon., n.d. Gibbs’ (1988) reflective cycle. university of cumbria.
hoffer, J. A. V., 2011. discributed database. In: 1. edition, ed. morden database management. s.l.:new
jersey, p. 512.
Page 39 of 39