0% found this document useful (0 votes)
120 views

Database

The document describes a database for Good Hope private clinic. It includes entities for patients, doctors, diseases, appointments, and more. The entity relationship diagram shows the relationships between entities. Tables are created based on the entities and normalized to third normal form to eliminate anomalies from updating duplicate data. Normalization splits the tables to avoid transitive dependencies between non-key attributes.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
120 views

Database

The document describes a database for Good Hope private clinic. It includes entities for patients, doctors, diseases, appointments, and more. The entity relationship diagram shows the relationships between entities. Tables are created based on the entities and normalized to third normal form to eliminate anomalies from updating duplicate data. Normalization splits the tables to avoid transitive dependencies between non-key attributes.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 39

Statement and Confirmation of Own Work

A signed copy of this form must be submitted with every assignment.


If the statement is missing your work may not be marked.

Student Declaration

I confirm the following details:

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

Date: 03 MAY 2021

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

Task 1: Description of Business


Good hope private clinic is a clinic based in Lilongwe, area 49, the main aim is to provide health services
to patients around the area and other parts near at an affordable fee payments are done though
medical scheme and cash. Good hope has a lot of clients and the data is recorded in hardcover. The
current paper base system holds data for Doctors, patients, appointments, prescription and also helps to
manages patients visit when they are admitted in the clinic. The current system also helps to manage
the clinic finances depending on the treatment received by the patient.

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

Task 2: Entity Relationship Modelling

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

Patient Patient ID Integer 11 Primary key


First name Varchar 255
Surname Varchar 255
Date of birth Date
Gender Varchar 255
Age Varchar 255
Appointment Appointment ID Integer 11 Primary Key
Patient ID Integer 11 Foreign Key
Date Date
Time Time Varchar
Doctor ID Integer 11 Foreign Key
Doctor Doctor ID Integer 10 Primary Key
First name Varchar 255
Surname Varchar 255
Gender Varchar 255
Address Varchar 255
Appointment Appointment
description Description ID Integer 11 Primary key
Appointment ID Integer 11 Foreign key
Prescription ID Integer 11 Foreign key
Number varchar 255
Payment varchar 255
Date Date
Time varchar 255
Doctor ID Integer 11 Foreign key
Patient ID Integer 11 Foreign key
Prescription Prescription ID Integer 11 Primary Key
Prescription Varchar 255
Description Varchar 255
Diseases Diseases ID Integer 11 Primary Key
Disease Varchar 11
Disease on patient Diseases ID Integer 11 Foreign key
Patient ID Integer 11 Foreign key
Appointment ID Integer 11 Foreign key

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.

How normalization used to check tables


Update anomalies occurs when duplicate data is updated only in one place and not in all instances.

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

Below shows the created script for Room type table

2. create table Room

Below shows the created script for Room table

Page 9 of 39
Statement and Confirmation of Own Work

3. create table visitor

Below shows the created script for visitor

4. Create table visit

Page 10 of 39
Statement and Confirmation of Own Work

Below shows the created script for visit

5. Create table Disease Category

Below shows the created script for disease category

Page 11 of 39
Statement and Confirmation of Own Work

6. create table Patient

Below shows the created script for patient table

Page 12 of 39
Statement and Confirmation of Own Work
7. create table appointment

Below shows the created script for appointment

8. create table prescription

Page 13 of 39
Statement and Confirmation of Own Work

Below shows the created script for prescription

9. create table Doctor

Below shows the created script of Doctor

Page 14 of 39
Statement and Confirmation of Own Work

10. create table disease

Below shows the script of created table disease

11. create table admission

Page 15 of 39
Statement and Confirmation of Own Work

Below shows the result of created script for admission

12. create table for appointment description

Page 16 of 39
Statement and Confirmation of Own Work
Below shows the result of created of appointment description

13. Creating table for disease on patient

Page 17 of 39
Statement and Confirmation of Own Work

Below shows the result of created table for disease on patient

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

1. Inserting date in the table for room

INSERT INTO Room(RoomID,Room_type,Room_number)

Values (1, 1, ”Room1”), (2, 2, ”room2”), (3, 3, ”room3”), (4 ,4, ”room4”);

Below shows the result of inserted data for room

2. Inserting date in the table for room type

Below shows the result of inserted data for room type

Page 19 of 39
Statement and Confirmation of Own Work

3. Inserting date in the table for patient

Below shows the result of inserted data in patient

Page 20 of 39
Statement and Confirmation of Own Work

4. Inserting date in the table for visitor

Below shows the result of inserted data in visitor

Page 21 of 39
Statement and Confirmation of Own Work

5. Inserting date in the table for visit

Below shows the result of inserted data in visit

6. Inserting data in the table of Doctor

Page 22 of 39
Statement and Confirmation of Own Work

Below shows the result of inserted data in doctor

7. Inserting date in the table for disease

Below shows the result of inserted data in disease

Page 23 of 39
Statement and Confirmation of Own Work

8. Inserting date in the table Disease category

Below shows the inserted data of disease category

9. Inserting date in the table admission

Page 24 of 39
Statement and Confirmation of Own Work

Below shows the result of inserted data of admission

10. Inserting date in the table appointment

Page 25 of 39
Statement and Confirmation of Own Work

Below shows the result of inserted data of appointment

11. Inserting date in the table prescription

Below shows the result of inserted data of prescription

Page 26 of 39
Statement and Confirmation of Own Work

12. Inserting date in the table for disease on patient

Below shows the result of inserted data of disease on patient

13. Inserting data in the table for appointment description

Page 27 of 39
Statement and Confirmation of Own Work

Below shows the result of inserted data of appointment description

Task 7 SQL REPORT


Below are the ten queries that will be useful for the organization, in this case we will be showing the SQL
script running in the database environment and the result set of query shown in the database
environment.

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

Below is the result of the script altered

2. Below is a script query that gives appointment number for each doctor

Page 29 of 39
Statement and Confirmation of Own Work

Below is the result of the script “grouped by”

3. Below is a script that select all visitors ordered by visitor name

Below is the result of the script order by asc

Page 30 of 39
Statement and Confirmation of Own Work

4. Below is a script showing the query of selecting

Below is the result of the script selected

Page 31 of 39
Statement and Confirmation of Own Work

5. Below is a script showing the query of update

Below is the result of the script updated

6. Below is a script showing the query of selecting for natural join

Page 32 of 39
Statement and Confirmation of Own Work

Below is the result of the script selected

Page 33 of 39
Statement and Confirmation of Own Work

7. Below is a script showing the query of selecting visitor

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”

Below is the result of the script selected

9. Below is a script showing the query of delete table room number

Page 35 of 39
Statement and Confirmation of Own Work

Below is the result of the script deleted query

10. Below is a script showing the query of patient table dropped

Page 36 of 39
Statement and Confirmation of Own Work
Below is the result of the script selected

Task 8: Distributed Database


Distributed Database is a logically interrelated collection of shared data physically distributed
over a computer network (hoffer, 2011).Distributed database is there to assume that their
access to the same database from each of these site over the network. Distributed database
involves fragmentation and replication. Therefore, there some factors that we might
considered when implementing a distributed database in future in order to expand by merging
with a similar company are making data available across an organisation, availability and Data
backup, reliability, performance.

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.

Monitoring and improving values this provide an implementation reliability in times of


database failure, the total system of the centralised database come to an abrupt. However, in
distributed database system when component fail the functioning of the system continues but
this can be at a reduced performance. Hence the distributed database will be reliable.
Performance When data is distributed across many site, data must be retrieved across a network as a
trade-off. Performance should be confronted, if the local database is significantly smaller than a central

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.

Task 9 Gibbs reflective cycle (1988) model


We are going to use the Gibbs’ (1988) reflective cycle which has six cycles which are
description, feelings, evaluation, analysis, conclusion and last is the plan which were taken after
all these cycles. (Anon., n.d.)
1. Description, the first part is to find out what happen. So in these scenario we were giving the
task to find the organization and come up with overview in which we did. And the second was
answering all the question that in the task 1 up to task 8
2. Feelings, for the first time I was terrified after go through all the question l was like how
am going to answer and explain in good writing language so that my lecture will not find
problem in making my assignment. But after gathering the information l feel strong and
l start my work by trying to find the right organization which l can use for this
assignment.
3. Evaluation, this assignment has all part good and worse side task 4 and 8 was fair to
answer but when it come for task 1,2and 3 these were the worse side of this
assignment, I tried to find answers and fortunately one manages to get what one wants
and all the things that were needed on that task were been answered which gives me
smile at the end of completing it. The other part was finding the information about the
organization that one had also some of the information which was not available in
public domain.
4. Analysis, Internet was the main source of all information that helped me to complete
the assignment although some of information were not available but I try to get some of
the information from books and slides and this give me a clear way to come to this end.
5. Conclusion, all in all, this was fruitful assignment it has helped me know some of the
information that I was not aware off and which I did not learn in class while taking this
module. but because of this assignment has taking me far where-by I did not think of. All
the task has been answered, this gives me hope that I have completed the whole
assignment.
6. Action plan, After all the though and the smooth road that I has new knowledge and if
this same or similar assignment or the similar scenario just happen to occur in really
world that will to deal with to research that I have taken when l was doing this
assignment and all information that l has gather. (Anon., n.d.)

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

You might also like