Aastha Paudel - Database Design and Development A1
Aastha Paudel - Database Design and Development A1
2|Page
Table of Contents
Activity-I: Relational Database System Proposal.......................................................................7
Introduction....................................................................................................................................7
Purpose...........................................................................................................................................8
Database..........................................................................................................................................9
Types of DBMS:.......................................................................................................................11
Relational Database.....................................................................................................................12
One-to-one architecture.......................................................................................................16
One-to-many architecture...................................................................................................17
Many-to-one architecture....................................................................................................17
Many-to-many architecture.................................................................................................18
3|Page
pgAdmin: A tool for effective database design.........................................................................27
Entity-Relationship Diagram......................................................................................................28
Validation of Data........................................................................................................................33
Effectiveness Assessment.............................................................................................................36
Conclusion....................................................................................................................................37
Introduction..................................................................................................................................37
Database Implementation...........................................................................................................37
Implementation Overview:......................................................................................................37
Output Examples:....................................................................................................................57
System Security............................................................................................................................61
4|Page
3. DML (Data Manipulation Language).............................................................................72
4. Join.....................................................................................................................................73
User Documentation:...............................................................................................................82
Technical Documentation:......................................................................................................88
System Flowchart:....................................................................................................................96
Conclusion....................................................................................................................................98
References......................................................................................................................................98
List of Figures
5|Page
Figure 8: room page snippet..........................................................................................................23
Figure 9: service page snippet.......................................................................................................24
Figure 10: service request page snippet........................................................................................25
Figure 11: reservation page snippet...............................................................................................26
Figure 12: checkout page snippet..................................................................................................27
Figure 13: pgadmin application.....................................................................................................27
Figure 14: ER diagram of the database..........................................................................................29
Figure 15: unnormalized tabular form...........................................................................................31
Figure 16: 1NF table......................................................................................................................31
Figure 17: 2NF table......................................................................................................................32
Figure 18: 3NF table......................................................................................................................33
Figure 19: guest page snippet........................................................................................................38
Figure 20: guest code1...................................................................................................................39
Figure 21: guest code2...................................................................................................................40
Figure 22: guest code3...................................................................................................................41
Figure 23: query for creating guest table.......................................................................................41
Figure 24: room page snippet........................................................................................................42
Figure 25: room code1...................................................................................................................43
Figure 26: room code2...................................................................................................................44
Figure 27: room code3...................................................................................................................45
Figure 28: query for creating room table.......................................................................................45
Figure 29: service page snippet.....................................................................................................46
Figure 30: service code1................................................................................................................47
Figure 31: service code2................................................................................................................48
Figure 32: service code3................................................................................................................48
Figure 33: query for creating service table....................................................................................49
Figure 34: service request page snippet.........................................................................................49
Figure 35: service request code1...................................................................................................50
Figure 36: service request code2...................................................................................................51
Figure 37: service request code3...................................................................................................51
Figure 38: query for creating service request table.......................................................................52
6|Page
Figure 39: reservation page snippet...............................................................................................52
Figure 40: registration code1.........................................................................................................53
Figure 41: registration code2.........................................................................................................53
Figure 42: registration code3.........................................................................................................54
Figure 43: query for creating reservation table..............................................................................54
Figure 44: checkout page snippet..................................................................................................55
Figure 45: checkout code1.............................................................................................................56
Figure 46: checkout code2.............................................................................................................56
Figure 47: checkout code3.............................................................................................................57
Figure 48: query for creating checkout table.................................................................................57
Figure 49: add button snippet........................................................................................................58
Figure 50: query table for added data............................................................................................58
Figure 51: update button snippet...................................................................................................59
Figure 52: query table for updated data.........................................................................................59
Figure 53: delete button snippet....................................................................................................60
Figure 54: deleted data snippet......................................................................................................61
Figure 55: query for deleted data...................................................................................................61
Figure 56: roles creation................................................................................................................62
Figure 57: group role name addition.............................................................................................63
Figure 58: name saving..................................................................................................................64
Figure 59: privileges setting..........................................................................................................65
Figure 60: password setting...........................................................................................................66
Figure 61: guest privilege setting..................................................................................................67
Figure 62: backup selection...........................................................................................................68
Figure 63: backup file selection.....................................................................................................69
Figure 64: data restoring................................................................................................................70
Figure 65: processes done..............................................................................................................70
Figure 66: query for select.............................................................................................................71
Figure 67: query for create............................................................................................................71
Figure 68: query for alter...............................................................................................................71
Figure 69: query for drop table......................................................................................................72
7|Page
Figure 70: query for truncate.........................................................................................................72
Figure 71: query for insert.............................................................................................................72
Figure 72: query for update...........................................................................................................72
Figure 73: query for deleting row..................................................................................................73
Figure 74: query for join................................................................................................................74
Figure 75: table of improvement...................................................................................................77
Figure 76: table for test plan..........................................................................................................82
Figure 77: graphical representation for user documentation.........................................................88
Figure 78: graphical representation for system documentation.....................................................95
Figure 79: system flowchart..........................................................................................................96
Introduction
It is crucial for organizations to maintain their competitive advantage and operational efficacy in
the current digital world by the effective data management. For our enterprise, this proposal
delineates a robust relational database management system (RDBMS) design. The suggested
method aims to speed up procedures and enhance data integrity in addition to facilitating in-
depth data analysis. By adhering to system and user requirements and utilizing appropriate
design tools and processes, this database will effortlessly connect with our present infrastructure.
Purpose
Efficient data administration and organizing is the primary objective for the effective database
system of our organization. The system is expected to facilitate essential operations such as
personnel management, project tracking, resource allocation, and customer communications. The
design will increase accessibility for many business stakeholders.
8|Page
Customers should be able to search for products using many criteria, such as category,
price range, and product name.
It should be feasible for customers to place orders for one or more products.
2. Administrators:
The administrator should have the authority to add, update, and remove products from the
catalog.
It should be possible for administrators to control the stock levels of each product.
Administrators should be able to control orders, examine them, and get information on
their status.
3. Technical specifications:
9|Page
The database management system (DBMS) should be a dependable database
management system (such as MySQL, PostgreSQL, or SQL Server).
Server Infrastructure: The system should be hosted by a stable server infrastructure that
has the capacity to handle expected traffic and load.
Framework for Development: The system should be developed using an appropriate web
application-supporting framework or platform, like ASP.NET, Django, or Ruby on Rails.
Database
A systematic set of data that can be electronically accessed and stored is called a database. The
purpose of databases is to securely and efficiently store, handle, and retrieve vast volumes of
data (Daniel, 2023). Simple systems like contact lists and sophisticated systems like enterprise
resource planning (ERP) systems are just a few of the uses for them.
The data that is stored is represented as records in a table. The database management
system (DBMS), a piece of software, provides an interface through which users and
programs can interact with the data. These include Oracle, PostgreSQL, and MySQL.
The tables, fields, and relationships between the data in a database are all described by its
schema.
A query is an expression that is used to ask a database to retrieve or alter data. It is
defined by a language like SQL (Structured Query Language).
Indexes are organized sets of data that speed up data retrieval operations.
Databases are vital for a wide range of applications in business, government, and other
fields because of their capacity to provide efficient data administration, retrieval, and
storage.
The following are the main functions and components of a database management system
(DBMS):
10 | P a g e
Effective Data Storage, Retrieval, and Update: Guarantees effective data storage, enables
speedy retrieval, and supports updates to preexisting data.
Controls user access and makes sure that only individuals with permission can carry out
specific tasks. This is known as user administration.
Data security safeguards confidential information by preventing unwanted access.
Throughout its existence, data integrity guarantees the precision and coherence of the
information.
Recovery and Backup: Offers procedures for recovering data in the event of data
corruption or loss.
Database engine: The database engine is the primary tool used to access and process data.
The structure that establishes how data is arranged and related within a database is called
a schema.
Query functionary: Query processors decipher and execute database queries.
Transaction organizer: Ensuring the uniform processing of all transactions while
maintaining the integrity of the database is the responsibility of the transaction manager.
Storage manager or memory: The storage manager is in charge of managing data storage
on physical storage devices.
Database utilities are tools designed to facilitate data movement, recovery, and backup.
Types of DBMS:
The different kinds of DBMS are as follows:
1. Hierarchical DBMS:
Tree like structure is provided for the data.
A single parent is allocated for every record.
Example can be taken for IBM's Information Management System (IMS).
11 | P a g e
Example can be taken for Integrated Data Store (IDS).
Relational Database
Data points with relationships between them are stored in and accessible through relational
databases (Harrington, 2002). The structure that it employs enables us to locate and retrieve data
in connection with other database elements.
Tables: Relations, another name for tables, are groups of rows and columns that are used
to store data. For instance, each table represents an entity, such as "Customers" or
"Orders".
12 | P a g e
Rows: Each row (or tuple) represents a single record or instance of the entity, containing
data for each attribute.
Columns: Order date, customer name, and other types of data are represented by each
column (or attribute) in a database.
Primary Key: Every database row is uniquely identified by a primary key, which is a
unique code. This key allows each record to be uniquely identified.
Foreign key: Foreign keys are restrictions on a database that force a relationship between
the data in two tables.
Field: One piece of data, or a field, is used to represent a particular attribute of the data
that is kept in a table.
Indexes: They can expedite the retrieval of data from a database table, but at the cost of
additional space and slower write processes.
13 | P a g e
Large data volumes can be managed via scalability, which can be enhanced vertically (by
giving existing machines greater power) or horizontally (by adding new machines).
The ACID qualities ensure trustworthy processing of database operations by combining
Atomicity, Consistency, Isolation, and Durability.
Normalization refers to the arrangement of data to minimize dependencies and
redundancy. There are two advantages to adopting normalized tables: fewer data
duplication and logical data interdependence.
MySQL: Online applications that is available as open-source with the feature of popular
RDBMS.
MS SQL Server: Due to the strong integration with Microsoft services and products
Microsoft SQL Server is characterized a commercial RDBMS.
SQLite: SQLite is one of the popular RDBMS for embedded devices and mobile
applications, which is small and file-based.
Examples of many applications that use relational databases are Simple personal data
management systems and sophisticated enterprise-level programs that demand high availability
and scalability.
MySQL: Well-known for its stability, speed, and ease of use, this web application
database is widely used.
Popular for its advanced features, flexibility, and standard compliance is PostgreSQL.
Full compatibility and additional features are offered by MariaDB, a MySQL derivative.
One popular RDBMS for mobile and embedded apps is SQLite, which is lightweight,
serverless, and self-contained.
RDBMS in Retail:
Scalability, resilience, and an abundance of features make the Oracle Database well-
known. Widely used in professional environments.
The vast toolbox and excellent performance of Microsoft SQL Server are well
recognized. Other Microsoft services and products are integrated with it.
Embedded RDBMS:
SQLite: Popular for embedded systems, applications, and devices due to its serverless
architecture and lightweight nature.
H2: Often used for development and testing, a small Java SQL database.
1. Open-Source RDBMS: Due to their affordability and adaptability, these are typically
preferred. Suitable for small and medium-sized enterprises, entrepreneurs, and developers
who favor open-source software.
15 | P a g e
2. Commercial RDBMS: Reliable, scalable, highly available systems with extensive support
and cutting-edge capabilities are needed by large businesses which tend to favor
commercial RDBMSs.
3. Cloud-Based RDBMS: It is ideal for such businesses that are wishing to take advantage
of the managed services, scalability, and flexibility provided by cloud platforms. Perfect
for apps that are cloud-native and modern.
4. NewSQL databases: ACID features are maintained along with the issues regarding
scalability. They are ideal for applications that demand a high degree of consistency, low
latency, and concurrency.
5. Embedded RDBMS: They are ideal for such applications like mobile apps, Internet of
things devices, and local programs when the database needs to be small, simple to set up,
and able to operate without a dedicated server.
All types of Relational Database systems have advantages and disadvantages that vary according
on the certain requirements of the system and organization.
One-to-one architecture
One table's row is related to another table's single row in a one-to-one relationship. This kind of
relationship is employed if there is only one corresponding entry possible for each entry in both
tables.
As an example,
16 | P a g e
A table that lists passport-related information.
Only one passport is permitted per person, and only one individual is linked to each passport.
One table should use a distinct foreign key that points to the other table's main key.
One-to-many architecture
One row from one table can be associated to several rows from another table in a one-to-many
connection. They are among the most prevalent relationships.
As an example,
Although each employee is only affiliated with one department, each department may have
several employees.
To access the main key of the parent table from the child table, use a foreign key.
17 | P a g e
Figure 2: one to many networks’ architecture
Many-to-one architecture
In essence, a one-to-many relationship is the opposite of a many-to-one relationship. Connection
is done between a single row in one table and multiple rows in another.
As an example,
Make use of a foreign key that points to the one-side table's main key in the many-side table
(child table) (parent table).
18 | P a g e
Figure 3: many to one network
The one-to-many relationship and SQL implementation are same. The relationship's point of
view makes a difference.
Many-to-many architecture
When two tables are related to one another, there is a many-to-many relationship between the
two tables. It is quite important to manage this kind of relationship using a junction table, which
is sometimes referred to as a join table or an association table.
As an example,
Multiple courses may be taken by a single student, and multiple students may enroll in a single
course.
To link the primary keys of both related tables, use a junction table with foreign keys referencing
them.
19 | P a g e
Figure 4: many to many network
20 | P a g e
Figure 5: interface: draw.io
Launching Draw.io
To use the online application, visit draw.io, or download the desktop application to use
offline.
Creating a Diagram:
Either locally or on your preferred cloud storage service, you can save your diagram.
PNG, PDF, SVG, and more formats are among the formats in which the diagram can be
exported.
21 | P a g e
Collaborate:
You have the option to release the diagram for others to view or utilize cloud storage to
provide access.
Benefit from the real-time collaboration features and work as a team.
Microsoft created Visual Studio Code, an open-source, free code editor that is sometimes
shortened to VS Code. The purpose of this tool is to create and troubleshoot contemporary cloud
and online applications. These are VS Code's salient characteristics:
22 | P a g e
Below is an intelligible presentation of how Visual Studio Code was used to design the system
development's interface.
23 | P a g e
Room page interface:
24 | P a g e
Service page interface:
25 | P a g e
Service request page interface:
26 | P a g e
Reservation page interface:
27 | P a g e
Checkout page interface:
28 | P a g e
One common relational database management system is PostgreSQL, and pgAdmin is an open-
source administration and management application for it. A few of pgAdmin's most important
characteristics are as follows:
The graphical user interface (GUI) offered by this tool facilitates interaction with
PostgreSQL databases, hence reducing the need for substantial command-line usage for
database management and querying.
Creating, editing, and deleting databases, tables, and other database objects is possible
with database management. Additions, deletions, and changes of data are also possible.
Write and run SQL queries with the help of this robust query tool. Syntax highlighting,
autocompletion, and query history are among the other features provided by the program.
Helps with understanding and designing the database schema through data visualization,
such as ER diagrams.
Data protection is ensured by facilitating database backup and restoration processes.
Server management provides a centralized interface for handling several database
instances, assisting in the management of multiple PostgreSQL servers.
Monitoring: Offers instruments for keeping an eye on database activity and performance,
which aids in locating and fixing performance problems.
Entity-Relationship Diagram
An illustration of the connections between entities in a database is called an entity-relationship
diagram, or ERD. To show the relationships and organization of a system, database designers
utilize it. An outline of its main elements is provided below:
Entities: Data can be stored about these things, which can be concepts. Generally
speaking, entities are nouns like "customer," "order," or "product." Rectangles are used in
ERDs to symbolize entities.
29 | P a g e
Attributes: These are the characteristics of each entity that we wish to keep on file.
Examples of properties that a "Customer" entity might have are "CustomerID," "Name,"
and "Email." Ovals attached to their entity rectangles typically represent attributes.
Cardinality: The numerical relationships between entities are defined by their cardinality.
It indicates how many instances of a particular entity can or need to be connected to
every instance of another. One-to-one, one-to-many, and many-to-many are familiar
cardinalities.
30 | P a g e
The hotel management system's structure is depicted in the Entity-Relationship Diagram (ERD)
that is provided. It emphasizes the connections between the various entities that make up the
system. Together with their unique characteristics and linkages, the main entities are
Reservation, Guest, Reservation_service, Service, Room, and Checkout.
Service name, pricing, and other attributes are part of the Service entity, which is recognized by
its primary key (ID). A one-to-many relationship exists between this entity and the
Reservation_service object, so that a service may be a component of more than one reservation.
Multiple services can be included in a reservation by using the Reservation_service entity as a
junction table with foreign keys referencing both the Service ID and the Reservation ID.
The Reservation entity, characterized by attributes like check-in date, check-out date, guest ID,
and room ID, establishes many-to-one relationships with the Guest and Room entities, indicating
that multiple reservations can be associated with a single guest or room. Additionally, the
Reservation entity maintains a one-to-one relationship with the Checkout entity, which details
the checkout date, total amount, payment method, and payment status, linking each reservation
to a corresponding checkout record. The Guest entity, containing attributes such as Name, Email,
and Contact number, also shares a one-to-one relationship with the Checkout entity, ensuring
that each checkout is tied to a specific guest.
Ensuring a thorough and well-organized database structure that facilitates effective data
administration and retrieval, the ERD successfully illustrates the intricate interactions between
services, reservations, guests, rooms, and checkouts inside the hotel management system.
31 | P a g e
Normalization and its different forms
To improve data integrity and minimize redundancy, normalization is the process of organizing
data in relational databases (Bates, 2011). Splitting a database into two or more tables and
establishing links between them are required for this. The main objectives are to ensure logical
linkages between data and to minimize redundant data. Typically, these are the most common
forms:
1NF (First Normal Form) ensures that the table is flat and free of recurrent groupings.
2NF (Second Normal Form) builds on 1NF by ensuring that each non-key property is
entirely functionally dependent on the primary key.
The Third Normal Form, also known as 3NF, demonstrates that every characteristic is
solely dependent on the primary key.
The values in the first row of this table are not unique. Therefore, it must be altered so that each
value in the table is distinct.
32 | P a g e
1NF or First Normal Form:
The provided table is in the first normalization form, with each field being unique.
In this second standard form of the data, it is ensured that there are no functional dependencies
within the table.
33 | P a g e
3NF or Third Normal Form:
This represents the third standard form of the data wherein the absence of partial dependency in
the table is ensured.
This eliminates the repetition in the table by employing several normalizing techniques.
Validation of Data
Data validation is the process of making sure it is correct, comprehensive, and satisfies all
applicable standards and requirements before the data is processed and used (Bates, 2011). This
entails verifying that data is accurate, consistent, and complies with certain guidelines or
requirements.
34 | P a g e
Ensuring error-free and accurate data.
Ensuring that all necessary data is complete.
Verifying consistency between datasets is part of the consistency process.
Assuring range checking of the data.
Verifying the format checking in the data.
Verifying that no two entries are the same.
Maintaining data relationships (such as foreign key limitations in databases) is an
example of integrity.
Data validation can be carried out automatically with software tools or manually at
various phases, such as during data entry, data transfer, or data processing.
There are two different parts to the larger process of data validation namely input data validation
and output data validation. At the moment of data entry or ingestion into a system, input data
validation takes place. Before being processed further, it makes sure that data that has been
imported or entered into a system satisfies certain requirements and is accurate, full, and clean.
Corresponding to this, output data validation checks the accuracy and quality of the resultant
data following data processing or computation. It makes ensuring that the data that a system or
process produces is trustworthy and satisfies expectations for the purpose for which it was
designed.
Rule: Verify the match between the data entered (e.g., text, date, numeric) and the intended data
type.
Make sure a phone number field only has numeric characters by using the following example.
Validating Formats:
As an illustration, confirm that the email address given contains the format
[email protected].
35 | P a g e
Validating Unique Keys:
Rule: Check for originality in the data to avoid duplications with unique key validation.
As an illustration, confirm that the product code you supplied does not already exist in the
database.
Rule: Ensure that data outputs from various components of a system or database are consistent
by using consistency validation.
Check that the total sales numbers in the various reports and summaries match, for instance.
Validating Accuracy:
Check, for instance, if the discount applied to a customer's order is computed accurately in
accordance with the established standards.
Validating Completeness:
Rule: Validate completeness by ensuring that all anticipated data outputs are present and
accounted for.
Check that all mandatory fields in a report that has been prepared have been filled up with
information.
With the use of these guidelines, systems can be made to create output data that is appropriate for
its intended use and input data that is correct, dependable, and submitted into the system.
36 | P a g e
Effectiveness Assessment
Assessment of the Database Design
The "Hotel Durbar View" has a simple and intuitive graphical user interface (GUI) for handling
visitor information. It functions for the intended purpose as per the fields such as guest, room,
service and so on. Users can rapidly grasp the Add, Delete, and Update buttons' capabilities
thanks to their clear labels and color coding. The program appears to support a number of
features in addition to guest management, including Room, Service, Service Request,
Reservation, and Checkout, based on the tab navigation at the top.
Overall, the design provides the essential features required for hotel management; nevertheless,
usability and user experience might be enhanced.
The "Hotel Durbar View" reservation system's architecture efficiently satisfies user and system
requirements by providing a user-friendly interface for bookings and service requests, gathering
thorough visitor data, and delivering crucial management reports. From a technical standpoint,
the system provides security with access controls, assures data integrity with normalization, and
37 | P a g e
sustains performance with scalable and efficient searches. Future enhancements can include
enhancing the mobile experience, integrating with other management systems, and improving the
user interface. All things considered, the design provides a safe, dependable, and efficient answer
to the hotel's operational needs.
Conclusion
To sum up, the database system's designing part has been carefully carried out to meet the
designated user and system requirements. A thorough and organized plan for the creation of a
fully functional database system has been effectively developed by the database design phase.
The design provides a strong basis for the ensuing phases of development and execution while
attending to all important user and system requirements. Going ahead, this design will help
create a dependable and effective database system that successfully satisfies the needs of the
firm.
Introduction
The construction and thorough testing of the relational database system created in the first phase
is the main focus of Activity 2. This entails putting the database structure into practice, creating
user interfaces, adding data validation, and making sure the system is secure. To further aid in
efficient operation and maintenance, technical and user documentation will be produced.
Delivering a completely functional, safe, and effective database system that satisfies all
requirements is the aim.
Database Implementation
Implementation Overview:
Guest Page:
38 | P a g e
Figure 19: guest page snippet
39 | P a g e
Figure 20: guest code1
40 | P a g e
Figure 21: guest code2
41 | P a g e
Figure 22: guest code3
Room page:
42 | P a g e
Figure 24: room page snippet
43 | P a g e
Figure 25: room code1
44 | P a g e
Figure 26: room code2
45 | P a g e
Figure 27: room code3
Service page:
46 | P a g e
Figure 29: service page snippet
47 | P a g e
Figure 30: service code1
49 | P a g e
Figure 34: service request page snippet
50 | P a g e
Figure 35: service request code1
51 | P a g e
Figure 36: service request code2
52 | P a g e
Figure 38: query for creating service request table
Reservation page:
53 | P a g e
Figure 40: registration code1
54 | P a g e
Figure 42: registration code3
Checkout page:
55 | P a g e
Figure 44: checkout page snippet
56 | P a g e
Figure 45: checkout code1
57 | P a g e
Figure 47: checkout code3
Output Examples:
Add button:
Once the "add" button is pressed, the data is entered into the table.
58 | P a g e
Figure 49: add button snippet
Update button:
If there are any necessary changes to the table, the data is input and the update button is clicked.
This will bring the table's data up to date.
59 | P a g e
Figure 51: update button snippet
Delete Button:
If additional data has to be deleted, selecting it will remove it from the table when you click the
erase button.
60 | P a g e
Figure 53: delete button snippet
61 | P a g e
Figure 54: deleted data snippet
System Security
Databases system safety refers to the measures used to protect data within a DBMS, which
stands for database management system, against intrusions, unauthorized access, and other
breaches of privacy. It is imperative to guarantee the security, accessibility, and authenticity of
data. Several crucial safety precautions include:
62 | P a g e
1. Login or Group Roles
Login and group roles are key ideas in information safety and access administration,
helping to control and limit user utilization of databases. Using login and group roles
effectively allows supervisors of databases to increase security, speed authorization
administration, and ensure that users have the appropriate access to database assets based
on their responsibilities within the organization.
To start the procedure, select the option for setting up user or group roles. Following that,
we'll be asked to provide the role name. Once the name has been added, the different data
responsibilities may be allocated. Privileges can also be expanded in this manner.
Database security can then be improved by adding the password afterwards. It is only
available to individuals who are Implementation:
63 | P a g e
Figure 57: group role name addition
64 | P a g e
Figure 58: name saving
65 | P a g e
Figure 59: privileges setting
66 | P a g e
Figure 60: password setting
67 | P a g e
Figure 61: guest privilege setting
68 | P a g e
Figure 62: backup selection
69 | P a g e
Figure 63: backup file selection
70 | P a g e
Figure 64: data restoring
71 | P a g e
1. DQL (Data Query Language)
Database retrieval is accomplished through the use of SQL and Data Query Language
(DQL). Data may be retrieved from a number of tables using the primary DQL
leadership, SELECT. Queries on the data are the main focus of DQL, not modifications
to it.
Commands:
72 | P a g e
TRUNCATE: Eliminates every row from a table while leaving the table intact. This process
releases the space that the table was using and is quicker than DELETE.
4. Join
To merge information from several tables based on an identical column, using the SQL
"join" clause. Using a join, multiple databases may have their data retrieved at once by
specifying connections across them. SQL queries support a few join types, such as
73 | P a g e
INNER JOIN:
It retrieves rows from both in tables where a match on exists based on the .
1. LEFT JOIN:
Retrieves every row from table 1 on the left and every row matching row from table 2 on the
right. NULL values are returned for the correct table if there is no match.
Syntax: SELECT columns FROM table1 LEFT JOIN table2 ON table1.column = table2.column;
2. RIGHT JOIN:
pulls up every row in table 2 on the right and every matching row in table 1 on the other
side from panel 2. In the unlikely case when there happens to be nothing to match, NULL
values will be provided for the left table.
Language: SELECT table1's columns, RIGHT JOIN table2, table1.column =
table2.column;
3. CROSS JOIN:
produces the Cartesian sum of each of the columns or all possible row combos from both
tables.
Table 2's syntax is a cross join. SELECT table 1's columns;
When retrieving and analyzing complex data from a number linked tables in MySQL
databases, these joins are necessary.
Example of JOIN:
• Confirming that the system is focused upon both practical and intangible factors.
• Verifying the connection to ensure that all components and types operate as planned.
• Apply full testing to verify the software's workflow from start to finish.
• The system's efficiency must be assessed under a variety of conditions, including heavy
load.
• Usability requires knowledge assessment and a consumer's layout.
• Security: Establish the structure's protection and identify any weakness places.
Security Measures
Protecting private information is a top issue, and this includes implementing access
restrictions and data security policies. Robust authorization and authenticity protocols are
implemented by the system to guarantee that certain features or data are only accessible
by authorized persons. Rights for various user roles may be defined by using strategies
such as access control based on role (RBAC). Individuals working at the reception area,
for instance, may be able to manage reservations, but only supervisors have the capability
to create reporting or change room specifications.
Performance Optimization
The system utilizes searching and filtering strategies that expedite retrieval of data in
order to maximize efficiency. By building structures for data that provide quicker
browsing of records stored in databases, indexing boosts query processing performance.
The system's ability to effectively manage different levels of demand is ensured by
routine evaluation and adjustment. Possible constraints in the layout of the app may need
to be examined, and network indexing and SQL query optimization may be necessary.
76 | P a g e
Figure 75: table of improvement
77 | P a g e
78 | P a g e
79 | P a g e
80 | P a g e
81 | P a g e
Figure 76: table for test plan
This hotel management application is designed for easy management of hotel operations,
including guest check-ins, room reservations, service requests, and checkouts. It provides a
graphical user interface (GUI) built with Tkinter for a user-friendly experience.
Getting Started
Install PostgreSQL
Download and install PostgreSQL from PostgreSQL Downloads.
Follow the instructions to set up your PostgreSQL server.
82 | P a g e
Go to the Project Directory: cd hotel-management
python main.py
This will launch the Tkinter GUI for the hotel management system.
Initial Configuration
Create Database Table:
Ensure the necessary tables are created in the PostgreSQL database. Use the SQL
commands provided in the System Documentation to set up the database schema.
Application Interface
Main Window
Tabs:
The main window contains different tabs for various functions:
Guest Management: Manage guest information.
Room Management: Manage room details.
83 | P a g e
Service Management: Manage available services.
Service Request Management: Manage service requests.
Reservation Management: Manage room reservations.
Checkout Management: Manage guest checkouts.
Navigation
Choose a Tab: To navigate between the many administration features, click the tabs
located at the top of the window.
Form Fields: Fill in the blanks with your info or edit it.
Buttons: To carry out operations like Add, Revision, Remove, and View, utilize buttons.
• Typical Tasks
Taking Care of Visitors
Include a New Visitor:
• Select the tab for guest administration.
• Enter the visitor's name, email address, and phone number.
• Press the Add button to store the visitor's information.
Remove a Visitor:
• Select a visitor from the roster.
• Press the Delete key.
• Verify the removal.
• Overseeing Rooms
Eliminate a Space:
• Choose a space from the roster.
• Select "Remove."
84 | P a g e
Verify that it was removed.
Managing Services
Remove a Service:
• Choose a service from the inventory.
• Select Delete from the menu.
• Verify the removal.
Managing Reservations
Revise an Arrangement:
• Pick an appointment from the available slots.
• Adjust the reservation's specifics.
• To take effect of shifts, click the Refresh tab.
85 | P a g e
Remove a Booking:
• Pick an appointment from the available slots.
• Press the Delete key.
• Verify the removal.
Managing Checkouts
• Before taking any action, confirm that all needed fields have been filled out.
Incorporate a Checkout:
To access the Checkout Administration tab, navigate.
• Type in your booking number, the date of checkout, the sum to be paid, and the remainder due.
• Press the Add button to store the checkout information.
Troubleshooting
86 | P a g e
Problems with Forms:
• Before taking any action, confirm that all needed fields have been filled out.
87 | P a g e
Technical Documentation:
Hotel administration duties, such as handling details about guests, room data, solutions, service
inquiries, bookings, and payments, are made possible by this Tkinter-based program. It makes
use of psycopg2 for linking databases and Mysql for keeping data.
Prerequisites
Establish the Hotel management database and then change to it by using this command: \c Hotel
management.
Establish Tables in Databases
The necessary tables may be created by using the subsequent SQL demands:
88 | P a g e
89 | P a g e
90 | P a g e
Set Up the Application
• The the Tkinter framework GUI program is launched by using this command.
91 | P a g e
Using the Application
Guest Prevention:
Add: Type in information and select "Add."
Modify: Choose a visitor, make necessary changes, then press "Update."
Handling checkout:
Add: Click "Add" after inputting the checkout data.
Update: Click "Update," select a checkout, and amend the information.
Select a checkout and hit "Delete" to remove it.
Upkeep
Get the most recent updates from the repository to keep your code up to date.
Information supervisors: Ensure that the table of data is regularly backed up and that
Latest updates are installed.
Problem Managing:
Identify problems as soon as they appear by looking through the program's logs for
errors.
Examine data password and the PostgreSQL server status for debugging connection
problems.
Variables absent: When doing processes, make sure that all required fields are filled out.
Mistakes: Look for error messages in the terminal window or program swift, then consult
the psycopg2 manual for solutions.
Snippets of Example Code
Connection between databases:
92 | P a g e
References
Tkinter Documentation
PostgreSQL Documentation
psycopg2 Documentation
93 | P a g e
Graphical representation for technical documentation:
94 | P a g e
System Flowchart:
95 | P a g e
meticulously documented for use later on. Data duplication and abnormalities are reduced by
normalizing procedures included into the system design, which also strictly enforces validity
requirements and restrictions to guarantee consistent data and quality. Although searching and
crawling strategies are used to ensure high efficiency, privacy is given first attention, with strict
access restrictions and data defenses in place to secure confidential data. With its scalable
architecture, the system can accommodate growing amounts of bookings and data from guests as
the hotel grows. It also comes with comprehensive professional manuals and data flow diagrams
to facilitate updating and maintaining it.
There are several prospects to enhance the system going forward. In order to better the entire
experience for both front desk staff and visitors, graphical modifications might be implemented
to update the aesthetic and increase usability depending on user input. Empowering customers to
manage bookings while getting warnings from their cellphones while on the road might be made
possible by creating an optimized mobile version of the system. It would increase visitor
participation and happiness to include Scheduled Announcements for discounted prices, signals,
and registration approvals. More ways for boosting the quality of services and optimize hotel
efficiency include integrating with other systems, including bookkeeping or CRM, or customer
relationship management, systems. Managers might examine trends, customer habits, and
scheduling patterns to make better tactical choices by putting sophisticated analysis capabilities
into practice All things considered, the "Hotel Durbar View" reservation system provides a
dependable and easy-to-use way to handle hotel bookings and customer service. Key elements
including reliability of data, protection, speed, and portability are highlighted in its current
architecture, which meets both immediate and long-term requirements. The hotel may further
maximize the system's possibilities and guarantee longevity by concentrating on additions
including user-friendly updates, cellular easy access, robotic interaction, system interactions,
sophisticated research, and enhanced security.
Conclusion
Lastly, the development and roll-out of the system's database has been meticulously planned and
executed in order to meet the specified needs of users and the system. The strategy began with a
detailed analysis of user demands in order to develop a dependable and accessible relationship
database solution. I.e. Addressing new threats and safeguarding private data would be possible
by improving safeguards like the use of multi- protected storage of data, and frequent security
audits. To conclude, including tracking of performance Tools would aid in the early detection
and preemptive resolution of problems by offering immediate insight into system variables like
load on servers and turnaround times. In the end, these upgrades hope to increase general hotel
profitability and visitor happiness by preserving and increasing its effectiveness and profitability.
96 | P a g e
Suggestions for Enhancement:
• Improved Data: Producing more advanced monitoring instruments might facilitate decisions
about strategy and provide more profound understanding.
• User Training: Users' productivity will increase as they acquire more skilled at using the system
through ongoing training.
The continued viability of the system may be ensured by implementing preparations to maintain
expansion that can accommodate increased amounts of data and additional functionality.
To sum up, the database system is a well-thought-out, completely working solution that
successfully satisfies system and user needs. The system can develop further and offer even more
benefit to the company if the suggested changes are put into practice.
References
Bates, M., 2011. PIC Microcontrollers. 3rd ed. s.l.:s.n.
Daniel, 2023. Database: What is it and how does it work?, s.l.: Datascientest.
Dennis, M. M. & Dayal, U., 1989. The architecture of an active databse management system.
ACM, 18(2), pp. 215-224.
Harrington, J. L., 2002. Relational Database Design clearly explained. 2nd ed. s.l.:ACM.
97 | P a g e