Database Design Development
Database Design Development
Learner declaration
Marks Awarded
First assessor
IV marks
Agreed grade
FEEDBACK FORM
INTERNATIONAL COLLEGE OF BUSINESS & TECHNOLOGY
1
Module/Title: SEC4205/Database Design Development
Student: H.M.H.S.Thilakarathna
Assessor: Induranga De Silva
Assignment: Database Design Development
Marks Awarded:
2
Introduction
Sri Lanka is facing at the moment one of the difficult time periods in controlling the
spreading of New Corona Virus (COIVD-19) among the people of the country. The
government is taking all possible measures as per the health guidelines and assistance given
by the World Health Organization (WHO). In the mission of fighting against the disease the
government ministries such as ministry of health, ministry of defense and ministry of public
security is leading in the front line with the direct coordination of National Operation Centre
for Prevention of COVID-19 Outbreak (NOCPCO).
The ministry of health has decided to implement information system to extract, aggregate and
manage information related to COVID-19 pandemic within the Island. The proposed
management information system is named as Sri Lanka COVID-19 Information Management
System (SLCIMS) and it’s incorporated with a Centralized Database named Sri Lanka
COVID-19 Information (SLC19I) Database This information system going to be managed by
the head office of Ministry of Health.
Executive Summary
The majority of people and businesses utilize databases to store their personal and business
information. It is the proper method of data storage. Many individuals develop databases
using various database technologies. Databases are used for a variety of purposes. Users can
obtain solid security support from databases, and they can query for whatever information
they desire. As a result, databases are one of the most important aspects of technology
This assignment is mainly done for the Sri Lanka COVID-19 Information Management
System of the Ministry Of Health. This assignment includes all the necessary information that
the SLCIMS needed. By doing this assignment it was able to gain these following:
3
Table of Contents
Introduction..............................................................................................................................16
Executive Summary.................................................................................................................16
1. Data Models.........................................................................................................................19
1.1 What is data base model?..........................................................................................19
1.2 Comparison of Hierarchical, Network and Relational data model............................19
I. Hierarchical Data Model...........................................................................................19
This can be represented as:..............................................................................................20
..........................................................................................................................................20
II. Network Data Model.............................................................................................20
This can be represented as:..............................................................................................20
III. Relational Data Model...........................................................................................21
1.3 Why older data models are being replaced by new data models.................................21
2. Comparing Database Management Systems........................................................................22
2.1 MySQL...........................................................................................................................22
2.3 MS SQL Server..............................................................................................................23
2.4 Oracle.............................................................................................................................23
2.5 PostgreSQL....................................................................................................................24
3. Different Database Approaches...........................................................................................25
3.1 Top – down design method............................................................................................25
3.2 Bottom – up design method.......................................................................................26
3.3 Centralized design..........................................................................................................26
3.3 Decentralized design.................................................................................................27
3.4 Advantages of different approaches...............................................................................28
3.4 Most suitable method for this organization...............................................................29
4. ER Diagram..........................................................................................................................29
5. Relational Mapping..............................................................................................................30
5.1 Strong Entity Mapping..............................................................................................30
5.2 Weak entity Mapping.....................................................................................................31
There are no weak entity......................................................................................................31
5.3 1:1 Mapping...................................................................................................................31
Update_Center......................................................................................................................31
5.4 1: M Mapping...............................................................................................................32
5.5 Final Tables...................................................................................................................32
6. Data Dictionary....................................................................................................................34
7. POSTGRE SQL...................................................................................................................36
8. SQL queries for manipulation functions..............................................................................38
4
9. Queries.................................................................................................................................39
9.1What is a query?............................................................................................................39
9.2 Purposes of queries......................................................................................................39
9.2.1 Queries Examples....................................................................................................40
10.Test plan..............................................................................................................................42
11. Verification and Validation, Object permission, Statement permission, Implied
permission................................................................................................................................44
11.1 Verification.................................................................................................................44
11.2 Validation....................................................................................................................44
11.4 Statement permission.................................................................................................46
2. Backup.............................................................................................................................46
4. Create query...................................................................................................................48
11.5 Implied permission.....................................................................................................48
12. Conclusion and Recommendations....................................................................................49
12.1 Conclusion...................................................................................................................49
12.2 Recommendations......................................................................................................49
12.2.1 Security.................................................................................................................49
12.2.3 Backups................................................................................................................49
13. References..........................................................................................................................50
References................................................................................................................................50
14. Gantt Chart.........................................................................................................................51
..................................................................................................................................................51
Table of Figures
5
Figure 15 doctor-Administration..............................................................................................39
Figure 16 Select........................................................................................................................41
Figure 17 where........................................................................................................................41
Figure 18 insert........................................................................................................................42
Figure 19 Update......................................................................................................................42
Figure 20 Delete.......................................................................................................................43
Figure 21 Verification..............................................................................................................45
Figure 22 Validation................................................................................................................46
Figure 23 Create a new data base.............................................................................................47
Figure 24 backup 1...................................................................................................................48
Figure 25 backup 2...................................................................................................................48
Figure 26 Create Table.............................................................................................................48
Figure 27 Create query.............................................................................................................49
Figure 28 Implied permission …………………………………………
49
Table of Tables
Table 1 Comparison of Hierarchical, Network and Relational data model.............................21
Table 2 DATABASE TECHNOLOGIES................................................................................25
Table 3 Data Dictionary...........................................................................................................34
Table 4 Test plan......................................................................................................................42
Table 5 Gantt Chart..................................................................................................................51
1. Data Models
6
1.1 What is data base model?
A "data model" is a logical linkage and data flow between diverse data components in a
digital world. It also describes how to save and retrieve data. Data models accurately express
information system needs, which are then utilized to provide the responses required to satisfy
those requirements. Data models can be used to decide what data is required and in what
format for different business operations.
Hierarchical Model
Network Model
Entity-Relationship Model
Relational Model
(Hiter, 2022)
7
I. Hierarchical Data Model
Hierarchical data models were among the first to be created. To save space, this was a file-
based model made in the shape of a tree. In this tree, child nodes might have several parents,
but each child node could only have one. A directory can contain more than one file or
directory.
This can be represented as:
(Pedamkar, 2022)
The network database model was developed to overcome shortcomings in the hierarchical
database architecture. This data format supports child-parent relationships, whereas the
hierarchical data structure does not. Children are referred to as members, but their parents are
referred to as owners.
This can be represented as:
8
Figure 2 Network Data Model
(studytonight, 2022)
The relational data model is the most common. This straightforward methodology helps
improve data processing and storage efficiency (tutorialspoint, 2022).
9
Difficult to access data Easier to access data Easier to access data
Less flexible Flexible Flexible
1.3 Why older data models are being replaced by new data models.
The solution is to alter things. The business has changed, and what technology need is
continually changing. Systems and their data help the business. However, as the organization
evolves, so will the data model. Technology advances and necessitates numerous data
configurations in order to work with newer infrastructure for data management, and these
new structures of "big data" and BI necessitate diverse data structures as well. As an example,
in the beginning, the organization created a data model to model a simple accounting system
that runs on a single IBM mainframe. When they transitioned to Client-Server distributed
processing, the data had to adapt in order to give data on each tier of the architecture. So data
changes as a result of changing needs and technology. (altexsof, n.d.)
A database management system is required for database maintenance. MySQL, Oracle, SQL
server, and other commercial databases are widely utilized in a range of applications. The
DBMS can execute a wide range of tasks, including database construction, storage, and
retrieval, as well as data updating and table creation. It ensures the database's safety and
security. Similarly, it assures data consistency when numerous users are engaged. (Mullins,
n.d.)
2.1 MySQL
pros cons
Data safety A few stability problems
Scalability on demand Prior experience is required.
10
Continuous availability Transactions are not processed quickly.
Complete transactional assistance
Pros Cons
2.4 Oracle
The Oracle Cooperative Association designed and maintains this relational database system.
It now supports multiple data models within a single database, including document, graph,
relational, and key-value. It has recently refocused on cloud computing in its most recent
releases. Oracle's proprietary database engine can be obtained as a free or premium license.
Pros Cons
Daily workflow innovations High price
Excellent technical support and Resource-consuming
documentation
Large storage capacity A difficult learning curve
2.5 PostgreSQL
11
This widely used database management system is related to MySQL. This object-relational
database management system combines user-defined objects and table procedures to create
more complex data structures (DBMS). PostgreSQL and MySQL share some similarities. As
a result of this initiative, standards for compliance and extensibility will be strengthened. As a
result, whether it's for a single computer or a big application, it can manage any workload. It
is owned and developed by the PostgreSQL Global Development Group, and it is still
entirely open source. This database management system is compatible with Microsoft, iOS,
Android, and numerous other platforms.
Pros Cons
Scalable Documentation that is inconsistent
Custom data types can be supported. a scarcity of reporting and auditing tools
Third-party technologies that integrate
easily
Community-driven and open source
12
applications in password protection Oracle innovates
by proactively
including Facebook, management
building in security
twitter, word press. features.
So my sql provides
high data security.
This comparison provides a good picture of these three database technologies. And it
demonstrates the differences between each technology, what types of data it supports, its
restrictions, the security levels of various technologies, and so on. Furthermore, it
demonstrates the types of advantages that consumers can obtain by utilizing various
technologies. (khalil, 2022) (Andrieiev,
2022).
Top-down design begins with the broad and works its way down to the specifics. Begin with
a general idea of what the system requires and work your way down to additional information
about how the system will function. During this operation, several entity types and their
attributes are recognized.
13
Figure 4 Top – down design method
This strategy is the inverse of the top-down method. It signifies that this strategy works from
specialized to universal. In this section, first identify the things and then group them together.
In other words, it first identifies the qualities and then assigns them to entities.
Centralized design is most effective when the data component is made of a relatively small
number of objects and procedures. The concept can be carried out and reflected in a simple
database. A centralized design for a simple or small database can be implemented
successfully by a single database administrator or a small design team.
14
Figure 6 Centralized design
Decentralized design may be the best solution when the data component of the system
includes a large number of entities and extensive relationships on which sophisticated
operations are performed. This strategy is likely to be used if the problem is spread across
numerous operational sites and the elements are a subset of the entire data set.
15
Figure 7 Decentralized design
(databasemanagement, n.d.)
This organization must choose the better of the two techniques. The top-down approach is
best suited to this company. Because the user can grasp the system quickly and effortlessly.
And decisions can be made and implemented rapidly. In addition, the user can gain a good
understanding of management and various levels of hierarchy. Top-down approaches are less
risky for projects. This model relies on the executive level to decide how to prioritize,
manage, and carry out daily processes. These ideas, which are mentioned above, give a clear
picture about the top-down strategy and illustrate that this approach is quite good for this
company.
16
4. ER Diagram
Figure 9 ER Diagram
5. Relational Mapping
Registration_Department
Patient
17
Doctor
Medical_Report
Update_Center
Administration
Administration
Update_Center
Patient
18
Registration Department
Medical_Report
Medical_Report
Administration
Update_Center
5.4 1: M Mapping
Patient
Doctor
Medical_Report
19
Doctor
5.4 M: M Mapping
Registration_Department
Patient
Doctor
Medical_Report
Update_Center
20
Medical Report
Administration
Update_Center
6. Data Dictionary
Table 3 Data Dictionary
21
Fname Varchar (10) Not Null First Name of
the Doctor
22
Administration A_ID Varchar (10) Primary Key ID of the
Administration
7. POSTGRE SQL
23
Figure 10 Registration
Figure 11 Patient
Figure 12 Doctor
24
Figure 13 Medical_Report
Figure 14 Update_Center
Figure 15 doctor-Administration
25
DELETE: Removes data rows from the database.
9. Queries.
9.1What is a query?
A query is a request for data or information from a database table or group of tables. This
data can be generated as SQL results or as pictorials. (janbasktraining, 2022)
26
query's results are stored in a result table, also known as a results table, in the result set. The
SELECT statement has three subcategories: FROM, WHERE, and ORDER BY. In addition
to grouping and aggregating data, the SQL SELECT query can summarize or analyze data. A
subquery and a join can also be utilized to extract unique data.
Select
Figure 16 Select
Where
Figure 17 where
This query is used to retrieve a specific detail from a table. You may also acquire the needed
value of a column by changing select * to select (column name).
Insert
27
VALUES('R03',1,'fever','2022-10-23');
This statement allows the user to add new values to the table.
Figure 18 insert
Update
UPDATE "Registration"
SET "rid"='R04'
WHERE "rid" ='R03'
28
Figure 19 Update
DELETE
Figure 20 Delete
10.Test plan.
Table 4 Test plan
29
TENNA','R01','D int
01') "rid_id
"
3 Check Data Insert varchar INSERT INTO Error duplica Succe
type type data to a "Patient" messa te key ss
int data type VALUES(1,'MA ge value
column HENDRA','BUD violate
DIKA',25,'MALE' s
,'THIBATUWAW unique
A TENNA','R02') constra
int
"rid_id
"
4 Check Data Insert more INSERT INTO Error value Succe
size than given "Patient" messa too ss
value to a VALUES('P03','K ge long
varchar data ASUN','FERNAD for
type column O',25,'MALE','TH type
IBATUWAWA charact
TENNA','R2') er
varyin
g(10)
5 Update a Update a data UPDATE Updat UPDA Succe
data in Registration "Registration" e TE 1 ss
column SET "rid"='R04' succes Query
WHERE "rid" sfully returne
='R3' d
succes
sfully
in 111
msec.
6 Delete a Delete a data DELETE FROM Delete DELE Succe
data in Registration "Registration" succes TE 1 ss
column WHERE sfully
rid='R04'; Query
returne
d
succes
sfully
in 88
msec.
7 Drop a table Drop the table DROP TABLE Error cannot Succe
Registration "Registration" messa drop ss
which pk is ge table
reference as a "Regist
fk in another ration"
table becaus
e other
objects
depend
30
on it.
8 Drop a table Drop the table DROP TABLE Delete DROP Succe
complain_actio "Administration" the TABL ss
n which hasn’t table E
a pk reference Query
as a fk in returne
another table d
succes
sfully
in 190
msec.
11.1 Verification
Verification is the process of ensuring that a database meets its objectives without flaws. It is
the process of determining whether or not the product being developed is correct. It
determines whether the developed product meets the needs of users. Static testing is what
verification entails.
Figure 21 Verification
"select * from branch where pid='P01" is an example query." It also gives the proper answer.
It means that this database produces accurate results. And this is the database verification.
11.2 Validation
Validation is the process of assessing whether a data element has the correct format. The
process of ensuring that the product developers are developing the correct one. It is a
comparison of the actual product to the expected one.
31
Figure 22 Validation
The name of this sample table is Patient, and the primary key 'P01' is repeated. It is not a
legitimate database entry. To add more data to the primary key column, the user must enter a
different value. In a database, this is known as validation.
(advanced-ict, 2022)
Example: 1. Select
SELECT * FROM "Patient"
This query returns all of the information in a given table.
2. Insert
3. Update
UPDATE "Registration"
SET "rid"='R04'
32
WHERE "rid" ='R03'
The query user can change the value of a table by using update.
4. Delete
DELETE FROM "Registration"
WHERE rid='R04';
The user can erase undesired data by executing this query.
Statement permissions enable a database user, database role, or Windows user or group to
execute numerous operations like as creating databases, creating objects, and backing up the
database.
After creating a new database, it will appear in the databases category of the object explorer pane.
This is depicted in the image as a demonstration.
33
2. Backup
Figure 24 backup
PostgreSQL includes the pg dump program to assist with database backups. It creates a
database file with SQL commands that can be simply recovered in the future.
3. Create Table
The CREATE TABLE statement in PostgreSQL is used to create a new table in any of the
supplied databases.
34
4. Create query
Members of fixed roles and database object owners have access to additional features and
functionalities in addition to the standard statement and object permissions. Implied,
preconfigured, and implicit permissions are all phrases used to denote different types of
rights.
For instance, having full access to the database. The owner of the "SLCIMS Database" in the
figure below is "postgres."
35
Figure 27 Implied permission (flylib, 2022)
12.1 Conclusion
The Ministry of Health now has a good database for this Sri Lanka COVID-19 Information
(SLCIMS) Database. This database contains information on patients, registration, doctor
administration, and other topics. This database will assist them in locating the records they
want. The mapping task demonstrates how these categories are related to one another. The
Administration Department can search the data in this database using the appropriate queries
that are indicated above, which will assist them in finding the data that they require. The
Ministry of Health employs a database administrator, who is assigned specific database and
server tasks. This document makes reference to them. If the Administration wants to edit or
update the database, the database administrator can do so.
12.2 Recommendations
This database is critical for this company now and in the future. As a result, this database
requires some suggestions.
36
12.2.1 Security
As a result, database security should be a key focus. A lack of security will endanger the
database and data. This organization will need a good server to run this data. They can obtain
a substantial security advantage if they run this server through the server.
12.2.3 Backups
In the event of a calamity, backups allow them to restore the database. Backups must be kept
in their departments and with a few confidential people or firms.
13. References
References
advanced-ict, 2022. Validation. [Online]
Available at: https://www.advanced-ict.info/databases/validation.html
[Accessed 22 October 2022].
altexsof, n.d. Comparing Database Management Systems: MySQL, PostgreSQL, MSSQL
Server, MongoDB, Elasticsearch and others. [Online]
Available at: https://www.altexsoft.com/blog/business/comparing-database-management-
systems-mysql-postgresql-mssql-server-mongodb-elasticsearch-and-others/
[Accessed 21 October 2022].
Andrieiev, S., 2020. SQL Server vs MySQL vs Postgresql. [Online]
Available at: https://jelvix.medium.com/sql-server-vs-mysql-vs-postgresql-which-one-is-the-
best-abfa830d7569
[Accessed 21 October 2022].
databasemanagement, n.d. Database Design Strategies. [Online]
Available at: https://databasemanagement.fandom.com/wiki/Database_Design_Strategies#
[Accessed 21 octocber 2022].
flylib, 2022. Types of Permissions. [Online]
Available at: https://flylib.com/books/en/2.908.1.63/1/
[Accessed 22 October 2022].
Hiter, S., 2021. What is Data Modeling?. [Online]
Available at: https://www.datamation.com/big-data/what-is-data-modeling/
[Accessed 04 August 2021].
37
janbasktraining, 2022. The Types Of Database Query And How To Use Them. [Online]
Available at: https://www.janbasktraining.com/blog/database-query/
[Accessed 22 October 2022].
khalil, M., 2022. SQL Server, PostgreSQL, MySQL... what's the difference?. [Online]
Available at: https://www.datacamp.com/community/blog/sql-differences
[Accessed 21 October 2022].
Mullins, C. S., n.d. database management system (DBMS). [Online]
Available at: https://searchsqlserver.techtarget.com/definition/database-management-system
[Accessed 21 October 2022].
Pedamkar, P., 2022. Hierarchical Database Model. [Online]
Available at: https://www.educba.com/hierarchical-database-model/
[Accessed 20 October 2022].
studytonight, 2022. DBMS Database Models. [Online]
Available at: https://www.studytonight.com/dbms/database-model.php
[Accessed 20 October 2022].
tutorialspoint, 2022. Relation Data Model. [Online]
Available at: https://www.tutorialspoint.com/dbms/relational_data_model.htm
[Accessed 21 October 2022].
October
Task Name Start Date End Date
17 18 19 20 21 22 23 24 25
Task 1,2,3 17/10/2022 18/10/2022
38