Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 29

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: [Ashiqur Rahman Pavel]

Candidate ID Number: [00184922]

Qualification: [L5DCBM]

Unit: [Database Design and Development]

Centre: [Penston Academy of International Studies]

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: [Ashiqur Rahman Pavel]

Date: [19th February 2023]

Page 1 of 26
645516144.docx
Table of Contents
Introduction................................................................................................................................................... 1

Task 1 Business Overview and Requirements............................................................................2

Business Overview......................................................................................................................2

Requirements..............................................................................................................................2

Task 2 ER and Data Dictionary...................................................................................................4

Entity Relationship Diagram (ERD)..........................................................................................4

Data Dictionary..........................................................................................................................4

Task 3 Normalisation....................................................................................................................6

Task 4 Scripts to create table structures.....................................................................................7

Scripts..........................................................................................................................................7

Development of the scripts.......................................................................................................12

Task 5 Data Population...............................................................................................................13

Creation of suitable data for the database...............................................................................13

Task 6 SQL reports.....................................................................................................................16

Task 7 Assessment of Design and Implementation...................................................................22

Task 8 Future Development of a data warehouse.....................................................................23

Task 9 Distributed Database Option..........................................................................................24

Conclusion....................................................................................................................................25

Reference......................................................................................................................................26
Introduction
A database is a space where data is stored in an organized manner. The information set up in a
database is easily accessible, updatable, and manageable. Due to a large amount of data
manipulation every day in the world data is being stored in computers and that is where the need
of data management system is most needed (Hale, 2020). A data management system helps to
keep all data stored securely with several options for alterations. As the world is now getting
more and more dependent on data it has gotten necessary for all organizations and their
employees to learn about data management systems. The most popular computer language that is
used to manage dat5a is SQL. This assignment will demonstrate the production of a database
using the MySQL server and SQL language. The assignment is divided into several tasks among
which it will produce an entity relationship diagram (ERD), a data dictionary, a discussion of the
use of normalization in developing the data model, snippets of scripts that will be used to create
table structures, data population, SQL reports, assessment of the design of the database and
implementation, discussion on the future development of a data warehouse and lastly a
distributed database option. The organization for this assignment will create the database for We
Road.

1
Task 1 Business Overview and Requirements
Business Overview
We Road is a UK-based travel agency. It was founded in 2017 by Erika De Santi. The vision We
Road was built upon is to connect people, stories, and cultures through traveling. We Road
executes group adventure travels for millennials (We Road, 2023). They have created a solution
for people traveling solo by giving them an appropriate companion. Their business is highly
online based. They have a working website through which they create groups and arrange
desired adventures for their customers. As a tourism-based business, they are now thinking of
collaborating with airports and airways to expand their business and to give their customers a
more explicit and organized experience. It will allow them to take air ticket bookings from their
customers. It will also increase their chance of having an increased and diverse customer range.
The business world of tourism is fast growing and the competition is increasing every day for
We Road. To stay in the competition successfully We Road needs to take the help of technology
and having an organized database system to process online air ticket booking will be a great
start.
Requirements

Figure 1 Online plane ticket purchasing details.

2
Source: (We Road, 2023).
To know the requirements of creating a database for online air ticket booking for We Road it is
necessary to know about their day-to-day operations. As an online-based business, most of its
operations are done via the internet on its website. They have to interact with customers every
day, learn about their requirements, answer their queries, provide hotel options, estimate prices
for customers, book hotels for customers, arrange groups with people having similar interests,
create unique and adventurous experiences for them, contact with hotels, train stations or any
other vehicle options, and so on. To process all these operations the data they need is customer
information, information on tourism places, hotel details, transportation details with expenses,
and so on. The types of transactions they perform every day are taking payments from
customers, paying hotels for bookings, paying for train and bus tickets, paying for special tourist
sports on behalf of the customers, and so on.

The scope of this database project is huge in the future for We Road. They can add many more
transportation booking services online. They can collaborate with many airlines and also hotels.
Now they are doing these offline and customers are getting very few options but with the help of
a database system customers will have more options. The physical labor of we road will also
decrease as every transaction and booking will be made online. Data like customer details,
employee details who are associating with customers, transactions, reservation details,
scheduling, plane ticket details, airport, airline, and seat no. everything will be included in the
database. This will fulfill the requirements of We Road which is to take online ticket booking
along with associating with the airports and airline companies.

3
Task 2 ER and Data Dictionary
Entity Relationship Diagram (ERD)
An ERD using the UML format including TEN (10) entities of the developed database is given
below.

Figure 2 ERD for the online ticket booking service of We Road.

Source: Own.
Data Dictionary
Data dictionary of the customer table:
Field Name Field size Data type Description Example
cust_ID 4 CHAR This defines the ID 0110
of a customer which

4
is also the primary
key of the table.
cust_name 45 VARCHAR () This is the John
customer’s name.
cust_age 8 INT The age of the 21
customer.
cust_phone 50 VARCHAR () The phone number of 080090801
the customer.
cust_email 60 VARCHAR () The email of the joghn@gmail.com
customer.
cust_address 65 VARCHAR () The address of the 17th road East
customer. Hampshire
cust_username 45 VARCHAR () The username of the John_1
customer using
which the customer
will open an account
on the website.
cust_pass 50 CHAR () The password of the a1S@
customer’s account.
cust_gender 10 VARCHAR () The gender of the Male
customer.
Integrity constraints of the table: All the foreign keys developed in the table are individual
integrity constraints. A foreign key can not be deleted or altered without altering the primary
keys. The customer table has no foreign key so there are no integrity constraints here. But the
other tables have integrity constraints binding them to other tables.

Task 3 Normalization
Normalization is a process of organizing data in a database and is used to reduce data
redundancy. (Taylor, 2019). It also ensures that data is stored logically in a database. Data
redundancy causes anomalies in a database and normalization helps to remove them.

5
There are four different types of normalization. One type is dependent on the other. To prove that
the entities in the created database are in 3NF first it has to be proven that they are in 1NF and
2NF. As it can be seen in the database all the attributes or data in the database have an atomic
value it can be said that the entities are in 1NF as this is the only condition an entity has to follow
to be in 1NF. Similarly, as the entities are in 1NF the chances of them being in 2NF have
increased. From the database, it can be said that all the non-key attributes are fully functional and
dependent on the candidate key. This is the second condition an entity has to fulfill to be in 2NF
(Celko, 2019). As all the entities of the database follow these two conditions it can be said that
the entities are in 2NF. To be in the 3NF the entities of the database have to be in 2NF and also
the entities have to be transitive dependency free. All the attributes in the database are very
organized and have no transitive depe4ndency which is why it can be said that the entities in the
created database are in 3NF.

By making sure all the attributes in the entities have atomic value, all the non-key attributes are
fully functional and dependent only on their candidate key and by keeping the attributes
transitive dependency free normalization was used to check tables are well structured. By
fulfilling all these points, the database was made data redundancy free. It also made the database
easily functional.

Task 4 Scripts to create table structures


Scripts
Scripts that were used to create the database are given below.
Script used to create the database:

6
Figure 3 Script used to create the database weroad_flightbooking.

Source: Own.
CREATE SCHEMA `weroad_flightbooking` ;
Script used to create Table:

Figure 4 Script of creating the customer table.

Source: Own.
CREATE TABLE `weroad_flightbooking`.`customer` (

7
`cust_ID` INT NOT NULL,
`cust_name` VARCHAR(45) NOT NULL,
`cust_age` INT NOT NULL,
`cust_phone` VARCHAR(50) NOT NULL,
`cust_address` VARCHAR(60) NOT NULL,
`cust_email` VARCHAR(65) NOT NULL,
`cust_username` VARCHAR(45) NOT NULL,
`cust_pass` VARCHAR(45) NOT NULL,
`cust_gender` VARCHAR(10) NULL,
UNIQUE INDEX `cust_phone_UNIQUE` (`cust_phone` ASC) VISIBLE,
UNIQUE INDEX `cust_username_UNIQUE` (`cust_username` ASC) VISIBLE);
Script to add primary key:

Figure 5 Script to add a primary key.

Source: Own.
PRIMARY KEY (`cust_ID`),
UNIQUE INDEX `cust_ID_UNIQUE` (`cust_ID` ASC) VISIBLE,
Script used to make alterations on a table:

8
Figure 6 Script to add a column in the customer table.

Source: Own.
ALTER TABLE `weroad_flightbooking`.`customer`
CHANGE COLUMN `cust_pass` `cust_pass` VARCHAR(50) NOT NULL ;
Script to insert columns in a table:

9
Figure 7 Script to insert a value or add a column in the table.

Source: Own.
INSERT INTO `weroad_flightbooking`.`customer` (`cust_ID`, `cust_name`, `cust_age`,
`cust_phone`, `cust_address`, `cust_email`, `cust_username`, `cust_gender`) VALUES ('001',
'John', '21', '080090801', '17th road East Hampshire', 'joghn@gmail.com', 'John_1', 'Male');
INSERT INTO `weroad_flightbooking`.`customer` (`cust_ID`, `cust_name`, `cust_age`,
`cust_phone`, `cust_address`, `cust_email`, `cust_username`, `cust_pass`, `cust_gender`)
VALUES ('002', 'Nikkita', '23', '080020904', '5th Avenue, London ', 'nikkita@yahoo.com',
'Nikki', '009911', 'Female');
INSERT INTO `weroad_flightbooking`.`customer` (`cust_ID`, `cust_name`, `cust_age`,
`cust_phone`, `cust_address`, `cust_email`, `cust_username`, `cust_pass`, `cust_gender`)
VALUES ('003', 'Riu', '26', '080859873', '6th, Avenue, London', 'riu@gmail.com', 'Riu',
'823947vgh', 'Female');
INSERT INTO `weroad_flightbooking`.`customer` (`cust_ID`, `cust_name`, `cust_age`,
`cust_phone`, `cust_address`, `cust_email`, `cust_username`, `cust_pass`, `cust_gender`)

10
VALUES ('004', 'William', '30', '080024539', 'east road westeros', 'willb@gmail.com', 'Will_iam',
'skjery6', 'Male');
INSERT INTO `weroad_flightbooking`.`customer` (`cust_ID`, `cust_name`, `cust_age`,
`cust_phone`, `cust_address`, `cust_email`, `cust_username`, `cust_pass`, `cust_gender`)
VALUES ('005', 'Zhang', '27', '080812536', 'Down Abey ally, 5th colony',
'27zhangu@yahoo.com', 'Zhang_u', 'jkdf7t6', 'Male');
INSERT INTO `weroad_flightbooking`.`customer` (`cust_ID`, `cust_name`, `cust_age`,
`cust_phone`, `cust_address`, `cust_email`, `cust_username`, `cust_pass`, `cust_gender`)
VALUES ('006', 'Rose', '19', '080867580', 'Eastern plaza square, London', '00rose@gmail.com',
'Rose_el', 'jwe6283', 'Female');
Script to add foreign key:

Figure 8 Script to add foreign key in tables.

Source: Own.
ALTER TABLE `weroad_flightbooking`.`reservation`
ADD INDEX `emp_idx` (`emp` ASC) VISIBLE;
;
ALTER TABLE `weroad_flightbooking`.`reservation`

11
ADD CONSTRAINT `emp`
FOREIGN KEY (`emp`)
REFERENCES `weroad_flightbooking`.`employee` (`emp_ID`)
ON DELETE NO ACTION
ON UPDATE NO ACTION;
This script of adding a foreign key in the tables have used to cause the integrity constraints in the
database mentioned in task two.
Development of the scripts
The scripts were developed following a logical database design. It was designed by keeping in
mind the day-to-day activity that is being carried out and will be carried out by We Road after
implementing the online ticket booking system. The order or running of the database scripts was
done in a very organized manner. First, the database was built, then the tables, and after that, the
tables were assigned with necessary attributes, then primary keys were added, and following that
foreign keys were added to build a relationship between the entities.
The use of SQL has enhanced the database and its functionality highly. SQL not only helped to
collect and store data but also to analyze the data and make informed decisions about the
business (Siksnys and Pedersen, 2017). It will also help the business in the future by increasing
its profits. The decisions of the table structure were taken based on the connections SQL allows
and the data types were also selected based on how they will support the SQL queries in the
future to enhance its usability.

12
Task 5 Data Population
Creation of suitable data for the database
Data used to populate the customer table:

Figure 9 SQL insertion scripts used to populate the customer table.

Source: Own.
Data used to populate the transaction table:

13
Figure 10 SQL insertion scripts used to populate the transaction table.

Source: Own.
Data used to populate the invoice table:

Figure 11 SQL insertion scripts used to populate the transaction table.

Source: Own.
Data used to populate the employee table:

14
Figure 12 SQL insertion scripts used to populate the employee table.

Source: Own.
The scripts were developed following an organized structure. Where first the database was
created, then the tables, then the primary and foreign keys. There were a few issues encountered
while writing the scripts. Maintaining so many primary keys was difficult. Also, while adding
the foreign keys there were a few errors but they were all eliminated in time.

15
Task 6 SQL reports
TEN (10) SQL queries that will be useful for We Road are given below.
1. CREATE TABLE:

Figure 13 Query to create a table.

Rationale: The purpose of this query is to create a table. We Road might need to add more tables
in the database if they wish to include more features on the website.
2. ALTER:

Figure 14 Altering a column.

Source: Own.

16
Rationale: This helps to make necessary alterations in the future of the database (Fritchey, 2018).
3. DROP COLUMN:

Figure 15 Drop a column.

Source: Own.
Rationale: The purpose of this script is to drop any unnecessary columns.
4. SELECT * FROM Table_Name WHERE Atribute_Name = ‘Data’ ;

Figure 16 WHERE query.

17
Source: Own.
Rationale: The rationale of this query is to select a specific item from an entity.
5. INNER JOIN

Figure 17 Inner join between two tables.

Source: Own.
Rationale: The purpose of this query is to join two connected tables and create a new database to
show.
6. UPDATE

Figure 18 Update table information.

18
Source: Own.
Rationale: The purpose of this query is to update any existing information in the database.
7. COUNT

Figure 19 Count query.

Source: Own.
Rationale: The purpose of this query is to count all the columns in a table.
8. GROUP BY:

Figure 20 GROUP BY query.

19
Source: Own.
Rationale: The purpose of this script is to group similar attributes in a table and show them
together.
9. CURDATE

Figure 21 CURDATE query.

Rationale: The purpose of this query is to get the current date of an entry.

20
10. INSERT INTO

Figure 22 INSERT INTO query.

Source: Own.
Rationale: The rationale of this query is to insert attributes in a specific table in a specific field.

21
Task 7 Assessment of Design and Implementation
The logical database is designed to help understand the data entities, elements, and relationships
between them. On the other hand physical database is designed to bring the logical database to
life. It designs the actual database based on the requirements set on the logical database.
(Borgida et al., 2018).

To map the logical database design into a physical database design was used. Help from MySQL
server was taken to transform the design. With many SQL scripts, the data transformation was
successful. For the logical database design, the entities and the necessary connections between
them were established which later was turned into reality with the help of physical database
design (Teorey et al., 2017).

The tables designed for the target database management system were based on the daily activities
the organization has to go through after implementing the online flight booking system.
Everything related to the tasks of an online booking system was considered an entity of the
physical database design. For example, the customers will be given an invoice after booking a
ticket. Here the invoice was considered an entity.

The tables with the foreign keys had derived data that were identified using the FROM clause.
The derived data in the database were represented by using a join clause and by creating a new
separate table that is more simplified (Pal, 2019).

Queries that have utility for the business are CREATE, SELECT, FROM, WHERE, JOIN,
ALTER, INSERT, and so on. All the requirements of the database that were set previously were
met using these queries as well. Primary and foreign keys are also some important functions of
the database that helped to fulfill the requirements of the database.

22
Task 8 Future Development of a data warehouse
A data warehouse is a system to integrate data and information collected from different sources
into one comprehensive database. It is also known as an enterprise data warehouse (Keppel et al.,
2020). A database stores current data too. Run an application where a data warehouse stores both
current and historic data. It stores data for one or more systems and is a more vast system than a
regular database. We Road is moving forward in the tourism industry and for it to achieve
success it is important to collaborate with different industries like the aviation industry and the
hotel industry. A database will help We Road to run a successful website but for the bigger
collaborations, it will need a bigger platform like a data warehouse. A data warehouse will help
the organization to keep all the necessary information regarding all its collaborations and also
new information about the changing industries it will associate with. It will give the organization
more opportunities to be organized and scope to collaborate with more businesses. There are
some additional reasons for We Road that might lead them to build a data warehouse.

 Trustworthiness: The data warehouse used by We Road can be used by all its
collaborating businesses at the same time. Any change in the system of one organization
will be notified to the other. This system allows businesses who collaborate to be truthful
which built a relationship of trust between them (Powell, 2017).

 Maintainability: A data warehouse is easy to maintain. As the space is bigger than a


database it has fewer collisions of data and works faster which makes it easier to operate
and manage (Vaisman and Zimányi, 2019). It also has different styles which help
organizations to identify each other’s works easily.

 Queries are easier to understand: A data warehouse is a simplified single model with no.
duplication of tables, confusing columns, and mysterious values which makes it easier for
We Road to understand and develop different queries easily.

23
Task 9 Distributed Database Option
A distributed database system is a database system that is stored in various physical devices in
various locations (Özsu and Valduriez, 2018). It is not limited to one system and anyone with
access to the system can use it from anywhere. We Road has a probability to merge with other
similar businesses in which case they can use a distributed database system to manage the merge
even from a distance. Although distributed database system is costly which seems like a huge
disadvantage for a small business it can bring many advantages with it as well.

The components of the distributed database system are great factors that might make We Road
consider implementing a distributed database. Some of the components. The distributed
database system are location independency, distributed query processing, distributed transaction
management, hardware independency, transaction transparency, operating system and network
independence, and so on (Peng Liu, 2021). All of these factors will work as huge advantages for
We Road in expanding their business in the future by merging with similar businesses.

A distributed database will be implemented online via all the other businesses that will take part
in the merging process. Every location the businesses are located in will have access to run and
operate the distributed database system (Wang et al., 2019). The other businesses can use the
replication process in the distributed database system to replicate the online flight booking
system. They can also use fragmentations. Take fragments of the system and implement that in
their base or distributed database process. Two varying types of distributed database systems can
also be used to perform a successful merging process for the business.

24
Conclusion
To conclude the assignment it can be said that a database system is the new future of data storage
for every organization. It is not only a data storage system but also a system that will keep data
organized and systemized. It is highly updatable and easy to operate. It provides organizations
with a great chance to expand in the future. The basis of creating a database is to create a logical
and physical database system. ERD and data dictionary are important parts of that system. To
create a data redundant-free system normalization is used. This assignment demonstrated
different scripts, data populations, and SQL reports to create a successful database system. The
future of databases is data warehouses and distributed databases using which a more advanced
data storage system can be built. This also gives businesses an immense opportunity for future
expansion and success.

25
Reference
Borgida, A., Casanova, M.A. and Laender, A.H. (2018) “Logical database design: From
conceptual to logical schema,” Encyclopedia of Database Systems, pp. 2137–2141.
Celko, J. (2019) “Embedded SQL, CLI Dynamic SQL, and SQL/PSM,” Joe Celko's SQL for
Smarties, pp. 795–813.
Fritchey, G. (2018) “SQL query performance tuning,” SQL Server Query Performance Tuning,
pp. 1–15.
Hale, W.R. (2020) DBMS: A secure system for a relational database management system.
Morgantown, WV, WV: West Virginia University.
Keppel, B., Müllenbach, S. and Wölkhammer, M. (2020) “Vorgehensmodelle im Bereich Data
Warehouse: Das Evolutionary Data Warehouse Engineering (EDE),” Data Warehouse
Managementhandbuch, pp. 81–105.
Pal, S. (2019) “SQL-on-big-data challenges & solutions,” SQL on Big Data, pp. 17–33.
Peng Liu, cha (2021) “Engineering a distributed intrusion tolerant database system using COTS
components,” Proceedings DARPA Information Survivability Conference and Exposition
[Preprint].
Powell, G. (2017) “Data Warehouse Architecture,” Oracle Data Warehouse Tuning for 10g, pp.
385–422.
Siksnys, L. and Pedersen, T.B. (2017) “Demonstrating solvedb: An SQL-based DBMS for
optimization applications,” 2017 IEEE 33rd International Conference on Data
Engineering (ICDE) [Preprint].
Taylor, A. (2019) “Normalization,” Introducing SQL and Relational Databases [Preprint].
Teorey, T., Lightstone, S. and Nadeau, T. (2017) “CASE tools for logical database design,”
Database Modeling and Design, pp. 187–211.
Vaisman, A. and Zimányi, E. (2019) “Data analytics: Exploiting the Data Warehouse,” Data
Warehouse Systems, pp. 329–383.
Wang, Y. et al. (2019) “Design and implementation of distributed memory management system
based on Local Area Network,” 2009 First International Workshop on Database
Technology and Applications [Preprint].

26
We Road (2023) Group travel on the road around the world., WeRoad. Available at:
https://www.weroad.co.uk/?
gclid=CjwKCAiAxP2eBhBiEiwA5puhNUDCKkhmgcxA3SNMjBEoO5y2nM-
DJTcQVVgRUAlCmDsRbVgsGd7rpBoC3AMQAvD_BwE (Accessed: February 5,
2023).
Özsu, M.T. and Valduriez, P. (2018) “Distributed database design,” Principles of Distributed
Database Systems, Third Edition, pp. 71–129.

27

You might also like