You are on page 1of 25

CC5051NI Databases

50% Individual Coursework

2022 Autumn

Student Name: Aarohan Subedi

London Met ID: 22015633

Assignment Submission Date: 05/01/2003

Word Count:
I confirm that I understand my coursework needs to be submitted online via Google Classroom under the
relevant module page before the deadline in order for my assignment to be accepted and marked. I am
fully aware that late submissions will be treated as non-submission and a mark of zero will be awarded.
1. INTRODUCTION

The report consists the detail about database design and working models of the Uber
rides. Uber rides is one of the leading transportation companies in the world. It is a
technology platform that enables users to request a ride with a few taps of their finger. It
connects riders to reliable, affordable rides in minutes. Uber is an international company
with services in over 60 countries and 600 cities around the world.

Uber's aim is to make transportation as reliable as running water, everywhere and for
everyone. This mission is supported by the company's focus on safety, innovation, and
sustainability. Uber works hard to ensure the safety of its riders and drivers, and to
make sure that everyone in the Uber community has the best possible experience.

In this project there is information about the uber app. The project gives the complete
record of the managemental aspects of the uber rides. It shows how the company
stores their data. First various types of data are collected and are stored separately and
are again linked together to form a functional database.
1.1. AIMS AND OBJECTIVES.

The primary aim of the Uber database is to provide the company with reliable, secure
and efficient data storage and retrieval. This data storage is used to store customer
information, driver information, and trip information. The database also supports the
company’s operations by providing analytics and insights. This allows the company to
optimize its operations, better understand customer behavior and develop new products
and services. In addition, the database supports the company’s financial operations by
providing data to generate reports and facilitate accounting.

The company have some objectives to pull off their goals. They are given below:

1. To store data related to customers, drivers, trips, and payments.

2. To maintain records of customer profiles, rider history and driver information.

3. To track and analyze customer and driver preferences.

4. To optimize customer experience and driver efficiency.

5. To store information related to various promotional campaigns.

6. To store data related to pricing, ratings and reviews.

7. To provide a secure platform to store and access data.

8. To generate reports and analyze customer and driver data.

9. To improve customer service and driver performance.

10. To ensure the highest level of security for customer and driver data.
1.2. Current business activities and operations

Uber ride current business activities and operations include ridesharing, food delivery,
freight, and electric scooter and bike rentals. Uber is also working on autonomous
vehicle technology, and is exploring new opportunities in the hospitality and travel
industries.

Business rules that should be followed by the transport company are:

 A driver may drive many vehicles, but each vehicle and a service are used by only
one driver at a time.
 A driver writes a single invoice for each service he provides.
 Once the customer books the service, they cannot cancel the service.
 Service ticket is issued once the customer books the vehicle and the service and
will include details like driver name, type of service, total charge, estimated
duration of the destination.
 The cost of the vehicle and duration can vary depending on its type. For example,
the cost of riding the motorcycle service can be cheaper than riding the car.
 Bill invoice is created after service is booked by the customer.

1.3. Assumption of business rules and activities

 Riders will accurately provide their payment information and personal information
when signing up.
 Most riders will use their accounts to request ride services.
 Majority of the riders will pay for their rides with a credit card or other accepted
payment method.
1.4. Current business activities and operations and list of Business rules
derived from operational procedures used in the system are
1.5. Framework of database schema:

Entities from the above business rules:

CUSTOMER ENTITY

Figure 1 Customer entity and attribute

VEHICLE ENTITY
Figure 2 Entity vehicle and its attributes

DRIVER ENTITY

Figure 3 Entity driver and its attributes

SERVICES ENTITY
Figure 4 Entity services and its attributes

2 INITIAL ER DIAGRAM

An Entity Relationship Diagram (ERD) is a visual representation of a database that


illustrates how data is related. It is a graphical tool used to define the logical structure of
a database. An ERD contains entities, which are used to represent the data, and
relationships between the entities, which define how the data is related. ERDs are used
to create a conceptual design for a database and are often used in conjunction with
other software engineering tools, such as data flow diagrams and user interface design
(Target, 2020).
2.1. Entity and attributes Identification

Figure 5 Entity and their identification

In this initial ERD, it is demonstrated that a single driver can own multiple vehicles, but
only one of these vehicles can be used at a time. Likewise, a vehicle can offer multiple
services, but each vehicle and service can only be used by one driver at a time.
Furthermore, multiple customers can book multiple services, but once they have booked
a service they are unable to cancel it.
A. Customer
Table Customer is a database table that stores information about customers. Its
attributes include:

Attributes Data type Constraints Description

Cus_ID INT PRIMARY KEY, Customer id is


UNIQUE typically a
numerical value
that is used to
identify the
customer in
various customer-
related
transactions.
Name VARCHAR (15) NOT NULL The customer’s
name attribute in
a customer table
is a field that
stores the name
of the customer,
typically in form of
first name and
last name with
varchar datatype.
Cus_Location VARCHAR (15) NOT NULL The customer
location attribute
in a customer
table stores the
geographical
location (city,
state, country) of
the customer,
which can be
used to locate the
customer.
Cus_destination VARCHAR (15) NOTNULL The customer
destination store
data that gives
the customer’s
home address
,shipping address
details.
Phone Number NUMBER (10) UNIQUE, NOT The customer
NULL. phone number
attribute in the
customer table is
a field that stores
the contact
number of the
customer. It is
typically used to
contact
customers for
sales, support,
and customer
service purposes.
Rating VARCHAR (15) The customer
rating attribute in
a table customer
is a numerical
score or rating
that customers
can give to a
business or
product, which is
used to measure
customer
satisfaction

Table 1 Description table for Entity Customer.

B. VEHICLE
Attributes Data type Constraints Description

Vehicle_ID INT PRIMARY KEY, Vehicle id is


UNIQUE typically a
numerical value
that is used to
identify the driver
in various
customer-related
transactions.
Registration VARCHAR UNIQUE, Vehicle
number NIOTNULL registration
number is an
attribute that is
used to uniquely
identify a vehicle
in a database. It
is typically
composed of a
series of numbers
and letters that
are assigned to
the vehicle when
it is registered.
V_Location VARCHAR (15) NOT NULL The vehicle
location attribute
in a vehicle table
stores the
geographical
location (city,
state, country) of
the customer,
which can be
used to locate the
customer.
V_Capacity NUMBER (5) NOT NULL The vehicle
capacity attribute
in a vehicle table
would describe
the total number
of passengers
that the vehicle
can hold. This
attribute would be
represented as
an integer or
decimal value.
Service Type VARCHAR (15) NOT NULL It defines the type
of service e.g.,
food, ride,
delivery etc.
Table 2 Description table of Entity Vehicle
C. SERVICES
Attributes Data type Constraints Description

Service_ID INT PRIMARY KEY, Service id is


UNIQUE typically a
numerical value
that is used to
identify the
services in
various customer-
related
transactions.
S_Type VARCHAR (15) NOT NULL It defines the type
of service e.g.,
food, ride,
delivery etc.
S_Date NUMBER (20) NOTNULL It gives
information about
the day and date
of service booked
Vehicle_ID INT FOREIGN KEY, Vehicle id is
UNIQUE typically a
numerical value
that is used to
identify the driver
in various
customer-related
transactions.
Availability status VARCHAR NOT NULL It shows whether
the driver is
online or offline.
Driver_ID INT FOREIGN KEY, Driver id is
UNIQUE typically a
numerical value
that is used to
identify the
services in
various customer.

Table 3 Description Table of Entity Service

D. Driver Entity
Attributes Data type Constraints Description

Driver_ID INT PRIMARY KEY, Driver id is


UNIQUE typically a
numerical value
that is used to
identify the
services in
various customer.
D_Name VARCHAR (15) NOT NULL The driver name
attribute in a
driver table is a
field that stores
the name of the
driver, typically in
form of first name
and last name
with varchar
datatype.
Bill no VARCHAR (15) NOT NULL, Bill No is an
UNIQUE attribute of the
Driver entity in
the Driver table
that stores the
unique bill
number
associated with a
particular driver. It
is used to identify
the driver when
processing
payments for
rides
Bill issued date VARCHAR (15) NOT NULL The Bill Issued
Date attribute in
the Driver table
would be used to
store the date on
which the bill was
issued to the
driver. This would
allow for tracking
of when the driver
was issued a bill,
making it easier
to manage billing
information.
Driver status VARCHAR NOT NULL It shows whether
the driver is
online or offline.
Phone Number NUMBER (10) UNIQUE, NOT The customer
NULL. phone number
attribute in the
customer table is
a field that stores
the contact
number of the
customer. It is
typically used to
contact
customers for
sales, support,
and customer
service purposes.
Vehicle Type VARCHAR (15) UNIQUE, NOT It is used to
NULL. identify what kind
of vehicle the
driver drives. This
information can
be used to
determine which
routes the driver
is qualified to
take, or to assess
the amount of
experience the
driver has.
Table 4 Description table of Entity Driver

2.2 Identify and Represent primary keys and foreign keys.

Driver Entity

 Driver_ID (PK) Driver_ID is a primary key attribute of the driver entity in the driver
table. It is used to uniquely identify each driver in the table and is used to identify
the record for each driver. This attribute is used to ensure data integrity by
preventing duplicate or incorrect entries in the table.

Customer Entity
 Customer_ID (PK) Customer ID is a primary key attribute of the customer entity
in the customer table. It is a unique identifier of the customer that is used to
differentiate between customers. This attribute is used to identify each customer
record in the database and is often used for joining data from other tables. It
ensures that each customer has a unique identifier, which helps maintain data
integrity.

Services Entity

 Service_ID (PK) A Service ID is a unique identifier for a particular service within a


database. It is typically used as the primary key attribute of the service entity in
the Service table. It also prevents two services from having the same
information.
 Driver_ID (FK) Driver_ID is a foreign key attribute of the Service entity in the
Service table. It references the Driver_ID attribute of the Driver entity in the
Driver table. Driver_ID is used to identify the driver associated with a particular
service.
 Vehicle_ID(FK) Vehicle_ID is a foreign key attribute in the Service table that
references the Vehicle table. This attribute is used to link the service record to
the vehicle it relates to.

Vehicle Entity
 Vehicle_ID (PK) Vehicle ID is an attribute that uniquely identifies each entry in
the Vehicle table. It is the primary key of the table, meaning that there can be no
duplicate entries. All entries must have a unique Vehicle ID, which is used to
uniquely identify a specific vehicle and maintain the integrity of the data (django,
2002).
2.3 ERD of the identified Entities with attributes and relationships.

Figure 6 Initial ERD


3 NORMALIZATION

Normalization is the process of organizing data in a database to minimize data


redundancy and improve data integrity. It involves organizing the fields and tables of a
relational database in order to reduce data redundancy and ensure data is stored
logically. Normalization also simplifies the querying and maintenance of a database.

Some normalization benefits are :

 It eliminates redundant data from the database.


 It eliminates the need for storing the same data in numerous tables.
 It eliminates data inconsistency, as related data is stored in only one place.
 It eliminates the need to modify multiple tables when data is changed.
 It increases data integrity, as data is not duplicated or stored in multiple locations.
 It reduces the amount of space required to store data.
 It simplifies the querying process, as related data is stored in the same table.
 It improves data accuracy and consistency, as data is entered only once.
 It allows for data to be easily retrieved and modified, as there is only one location
where it is stored.

ENTITIES AND ATTRIBUTES

Entity Attributes
Customer Cus_ID (PK), Cus_Location,
Cus_destination, phone number, Name,
Rating.
Vehicle Vehicle_ID (PK), Registration number,
V_location, V_Capacity, Service type
Services Service_ID(PK), S_Type, S_Date,
Vehicle_ID(FK), Availability Status,
Driver_ID(FK)
Driver Driver_ID(PK), D_Name, Bill no, Bill
issued date, Driver Status, Phone
number, Vehicle Type.
Table 5 Entities and attributes before normalization

APPLYING UNF
Uniform normalization (UNF) is a data normalization method which involves
transforming data into a uniform format or structure. This may include standardizing
column names, combining columns, or modifying data types. It is often used to ensure
that data is consistent across different systems or sources.

UNIFORM NORMALIZATION
Driver (Driver_ID,Driver_name,Bill no, Bill issued date, Driver Status, Phone number
Vehicle Type {Vehicle_ID,Regestration No, V_Location, V_Capacity, Service Type
{Service_ID, S_Type,S_date,Vehicle_ID,AvailabilityStatus,Driver_ID { Cus_ID, Name,
Cus_Location, Cus_destination,Phone number,Rating}}})
Table 6 UNF of Uber rides

OUTCOME: Repeating data are listed inside of small bracket and repeating group are
listed inside curly bracket.
UNF TO 1NF:
The First Normal Form (1NF) requires that a relation should be structured as a table
with no repeating groups, meaning that each column should contain a single value and
not a list of values. This restriction is built into the relational model with the goal of
simplicity and uniform access.

UNIFORM NORMALIZATION
Driver (Driver_ID,Driver_name,Bill no, Bill issued date, Driver Status, Phone number
Vehicle Type {Vehicle_ID,Regestration No, V_Location, V_Capacity, Service Type
{Service_ID, S_Type,S_date,Vehicle_ID,AvailabilityStatus,Driver_ID { Cus_ID, Name,
Cus_Location, Cus_destination,Phone number,Rating}}})
UNF TO 1NF
Driver (Driver_ID, Driver_ Name, Bill issued date, Bill no, Phone number, Driver
Status, Vehicle Type)
Vehicle (Vehicle_ID, Registration number, V_Location, V_Capacity)
Service (Service_ID, S_Type, S_date, Availability Status)
Customer (Cus_ID, Cus_Location, Cus_destination, Phone number, Name, Rating)
Table 7 1nf

APPLYING 2 NF
Driver Details of Driver Details of Bill
Driver_ID D_Name Bill issued date
Phone number S_Date
Driver Status. Driver_ID Bill no

Table 8 2nf

OUTCOMES:
Service Service Details
S_Type Service_ID
S_Date Vehicle_ID
Availability Status Driver_ID
Table 9 service and service details

Customer Customer Details


Cus_ID Name
Driver_ID Rating
Bill no Phone Number
Service_ID Cus_Location
Vehicle_ID Cus_destination
Table 10 Customer and customer details

Vehicle Vehicle_Details
Vehicle_ID Model
Driver_ID Registration number
V_Capacity
Service Type
V_Location
Table 11 Vechile and vechile details
APPLYING 3 NF

Third Normal Form (3NF) is a database normalization technique that is used to organize
data into logical entities. It is the third step in a database normalization process that
aims to reduce data redundancy and improve data integrity. 3NF is designed to ensure
that all data within a database is stored and accessed in the most efficient and logical
manner possible. 3NF requires that all data within a database is organized into separate
tables, each of which is linked together using foreign keys. The tables should contain
only data that is necessary for the purpose of the database, and all data should be
related to the primary key of the table.

Service Bill
Service Type
Bill amount
Bill duratuion
Table 12 Service bill table

OUTCOMES: When a customer books a service, they are issued a Service Ticket that
cannot be cancelled. This requires the use of transactional queries.
4 Final Erd

Figure 7 Final ERD


References
django. (2002). https://www.django-rest-framework.org/api-guide/relations/.
Target, T. (2020).
https://www.techtarget.com/whatis/definition/entity#:~:text=2)%20In%20relation%
20to%20a,stated%20relationships%20to%20other%20entities.

You might also like