the logical structure of the database. This allows
applications to be unaffected by changes in data
representation or storage methods. RM is used in this
study for two reasons. The first is that RM uses
primary and foreign keys to ensure data integrity and
consistency across tables, thus accurately maintaining
relationships between data. The second is that
efficient query processing can be implemented in RM
due to its structured format and allows for fast and
reliable execution of complex queries.
For the structure of the RM, the table is the basic
unit of data in the RM, and each table represents a set
of entities. Each table has a Primary key (PK) that is
used as a unique identifier for each record in the table,
ensuring that there are no duplicates. The Foreign key
(FK) joins the tables by referring to the PK of the
other tables, thus implementing the relationship
between each table.
To convert the ER diagram to RM in this
experiment, each entity is first transformed into a
relational schema, and the attributes of the entity are
the attributes of the relational schema. It then
classifies the type of relationship between every two
entities, which can be divided into three types: one-
to-one, one-to-many, and many-to-many. For a one-
to-one relationship, the PK of an entity at either end
is added to the table of the entity at the other end as
FK. For one-to-many relationships, the PK of one end
entity is taken as FK of many end entities. For a
many-to-many relationship, an intermediate table is
created to hold the primary keys of the two entities
and the necessary attributes. After these steps are
completed, the preliminary RM is obtained.
Next, the normalization operation is entered, the
database redundancy will be reduced with the
increase of normal form (NF), but too high NF will
lead to increased query complexity and increase the
overhead of update operation, etc. Therefore, 3NF is
the most balanced scheme in this study. 1NF first
ensures atomicity of the table, every column of the
table cannot be decomposed. 2NF eliminates the
partial dependence of non-primary attributes based on
1NF. The transitive dependency is subsequently
eliminated thus completing the 3NF. After these
steps, the complete RM is obtained.
2.2.3 MySQL Implementation
MySQL is a popular open-source SQL database
management system developed by Oracle
Corporation. MySQL has the ability to manage
structured data collections and to add, access, and
process data stored in the database (Christudas,
2019). MySQL was chosen for this study precisely
because of its stability, scalability, and ease of use, its
strong support for relational databases, and its ability
to process large amounts of data efficiently.
To implement this system using MySQL, first
convert RM into a SQL statement compatible with
MySQL environment, define the table, set the
primary key foreign key, and then create the table
using MySQL's Data Definition Language (DDL) and
specify the appropriate data type for each column. In
this study, the appropriate data type is used to ensure
data integrity and accuracy, and improve storage
efficiency and query performance. In the third step,
PK and FK indexes are added to improve the query
performance. After a series of table creation, the
fourth step uses MySQL's Data Manipulation
Language (DML) to insert data to simulate the actual
hospital management scenario. The fifth step is to
write Data Query Language (DQL) and execute it.
These queries are used for common retrieval and
update operations that may appear in hospital
management, which is a big means to improve the
efficiency of hospital operation. Through such a
series of complete steps, the hospital database
management system is effectively completed in the
MySQL environment.
3 RESULT AND DISCUSSION
In the result section, two key results of the hospital
management database system will be presented: the
structure of partial tables, the results of data query.
These results show in detail how the system can deal
with complex operations in hospital management
safely and efficiently under the guarantee of data
integrity through appropriate design.
3.1 The Structure of Partial Tables
The “Patient” table stores information data for
“Patient” entities. The primary key is Patient ID,
Since multiple patients may visit is the same
Consulting Room, resulting in a one-to-many
relationship, the Consulting Room ID is referenced as
the foreign key of the table to be associated with the
“Consulting Room”,and the structure design result is
shown in Table 1.