You are on page 1of 16

Introdction

Technology has become part of everyone’s lives and is the most important
element in today’s societies and its role in everyone’s lives keeps getting complex. Using
a technology means using gadgets like: PS4, cellphones, iPods, Personal Computers or
Laptops and many more. Computers are commonly used device in many ways. It is one of
the most system for people, especially the people who run Industry or organizations. A lot
of jobs today require the use of computers. It assists business progression and other
activities. It makes the work simpler and less time consuming. It makes very easy to access
and use data for business application.

The IT students and IT specialists in the IT industry use database to organize and
collect data. The project addresses the study and development of an Online Bus Ticketing
System or an Online Bus Scheduling; it enables both the bus operators and the customers
to make an online bus ticket sale or purchase. The proponents developed a database
interconnected with the Victory Liner's travel itinerary, where it displays information of
the bus, bus drivers, routes, dispatching list of buses, bus scheduling, time arrival and other
information about the trip; with the help of database, sorting and orienting of the data and
tables where it can show information are easier and organized. Traditionally, bus ticket
purchase has been over the counter in bus terminals, however, modern era has it evolved
with the rapid expansion of technology. The entire project and database features
convenience and assistance with utmost skills in the future development that would support
a fully integrated system that links bus operators to customers, bus operators to other mode
of transport providers, bus operator to businesses and bus operations.

In this modern and globalize world a lot of thing might change. The way people
work are no longer the same. In this modern world by the help of technology speed and
reliability is the key to success. In fact in doing business, a lot of entrepreneurs depends in
computers and fast growth of technology.

Page | 1
In this figure show the Entity Relational Diagram of the Database wherein we have
created a database for a Bus company Victory Liner. We created 10 tables that has the
necessary information and recipes in creating a database of a Bus Company, it shows the
Bus information that has a many-to-many relationship to the Passenger information,
Routes, Online Reservation, Schedule, Transaction. Next is the Passenger that has a one-
to-many relationship Transaction and Bus Information. Next is the Driver that has a one-
to-many relationship to the Conductor. Next is the Schedule that has a one-to-many
relationship to the Transaction and Bus information. Next is the Online Reservation that
has a one-to-many relationship to the Bus information.

Page | 2
Data Dictionary of BUS Table

Field Name Data Type Field Size Example


BUS_ID Integer 11 1001
BUS_TYPE Enum Ordinary
AVAILABLE_SEATS Integer 2 45
PLATE_NO Integer 6 ABC123
CHASSIS_NO Text 12 312QWE533
TERMINAL_NO Integer 11 300105
ROUTE_ID Integer 11 200107

In this figure the customer can see the details about the Bus’s ID, Kind of Bus Type,
how many seats are available, plate Number of the bus, chassis Number, Terminal Number
and the route ID.

Data Dictionary of CONDUCTOR Table


Field Name Data Type Field Size Example
CONDUCTOR_ID Integer 11 2001
LAST_NAME varchar 255 Creus
FIRST_NAME varchar 255 Luna
ADDRESS varchar 255 Ipo St.Quezon City
DATE_OF_BIRTH Date 10/10/1992
NBI_ID Integer 11 11654432
DRIVER_LICENSE varchar 255 N06-12-013765

In this figure the customer can see the details about the Conductor to assure security.

Data Dictionary of DRIVER Table


Field Name Data Type Field Size Example
DRIVER_ID Integer 11 DR100101
LAST_NAME varchar 255 Lebron
FIRST_NAME varchar 255 James

Page | 3
ADDRESS varchar 255 Tondo, Manila
DATE_OF_BIRTH Date 10/10/1992
NBI_ID Integer 11 11654798
DRIVER_LICENSE varchar 255 B10-11-013143

In this figure the customer can see the details about the Driver’s information.

Data Dictionary of FARE Table


Field Name Data Type Field Size Example
FARE_ID Integer 11 5000101
KILOMETER Integer 6 8
FARE decimal (4,2) 60

In this figure the customer can see how much the fare will cost and other details.

Data Dictionary of FARE_DISCOUNT Table


Field Name Data Type Field Size Example
FARE_TYPE_ID Integer 11 1
DESCRIPTION varchar 255 Student
DISCOUNT Integer 11 20

In this figure the customer can see how much fare discount the customer may get and
see other fare discount information.

Data Dictionary of ONLINE_RESERVATION Table


Field Name Data Type Field Size Example
RESERVATION_ID Integer 11 DR100101
USER_NAME varchar 255 Lebron
PASSWORD varchar 255 James
EMAIL varchar 255 Tondo, Manila
FIRSTNAME Date 10/10/1992
LASTNAME Integer 11 11654798
BIRTHDATE varchar 255 B10-11-013143
CONTACT_NO Integer 11 9364569
ADDRESS varchar 255 Iba St. Quezon City
TRIP enum 530
TERMINAL_ID Integer 11 300103
BUS_ID Integer 11 1003
BUS_TYPE enum DELUXE

Page | 4
SEAT_NO enum 1C
PLATE_NO varchar 255 AAC113
AVAILABLE_SEATS Integer 11 45
DATE_OF_RESERVATION date 12/3/2019

In this figure, this is where the customer can input the overall data or details of the
customers.

Data Dictionary of PASSENGER Table


Field Name Data Type Field Size Example
PID Integer 11 20101
LASTNAME varchar 255 Luna
FIRSTNAME varchar 255 Jerwin
SEAT_NO enum 255 1A
BUS_ID Integer 11 1008
TERMINAL_ID Integer 11 200108
FARE_TYPE_ID Integer 11 2

In this figure the user can the details about the Passenger.

Data Dictionary of ROUTES Table


Field Name Data Type Field Size Example
ROUTE_ID Integer 11 200101
ROUTE_NAME varchar 255 Pangasinan
TERMINAL_ID Integer 11 3000101
BUS_ID Integer 11 1001

In this figure the user can see the details about the Destination or routes.

Data Dictionary of SCHEDULE Table


Field Name Data Type Field Size Example
SID Integer 11 100002
TRIP Enum 530
DATE_SCHEDULE date 8/8/2018
BUS_ID Integer 11 1009
TERMINAL_ID Integer 11 300107

Page | 5
In this figure the user can see the details about the date, time and other details of the
bus schedule

Data Dictionary of TRANSACTION Table


Field Name Data Type Field Size Example
TRANSACTION_ID Integer 11 20101
TRANSACTION_DATE date Luna
ROUTE_ID Integer 11 Jerwin
TERMINAL_ID Integer 11 1A
FARE_TYPE_ID Integer 11 1008
BUS_ID Integer 11 200108
PID Integer 11 2
FARE Decimal (4,2) 1.30

In this tables show the Data Dictionary of the Transaction table of the database.

Database Schema of BUS Table

Field Data Type Null Key Default


BUS_ID int (11) No PRI
BUS_TYPE enum Yes NULL
AVAILABLE_SEATS int (2) Yes NULL
PLATE_NO varchar (6) Yes NULL
CHASSIS_NO varchar (12) Yes NULL
TERMINAL_ID int (11) Yes MUL NULL
ROUTE_ID int (11) Yes MUL NULL

In this figure the user can see the details about the Schema of the bus.

Database Schema of CONDUCTOR Table


Field Data Type Null Key Default
CONDUCTOR_ID int (11) NO PRI
LASTNAME varchar (255) NO
FIRSTNAME varchar (255) NO
ADDRESS varchar (255) NO

Page | 6
DATE_OF_BIRTH date NO
NBI_ID int (11) NO
DRIVER_LICENSE varchar (255) NO

In this figure the user can see the conductor’s information and the schema also

Database Schema of DRIVER Table


Field Data Type Null Key Default
DRIVER_ID varchar (15) NO PRI
LASTNAME varchar (25) YES NULL
FIRSTNAME varchar (25) YES NULL
ADDRESS varchar (70) YES NULL
DATE_OF_BIRTH date YES NULL
NBI_ID int (11) YES NULL
DRIVER_LICENSE int (11) YES NULL

In this figure the user can see about the schema, information of the driver.

Database Schema of FARE_DISCOUNT Table


Field Data Type Null Key Default
FARE_TYPE_ID int (11) YES NULL
DESCRIPTION varchar (255) YES NULL

In this figure the user can see the schema and the information about the discounts.

Database Schema of ONLINE_RESERVATION Table


Field Data Type Null Key Default
RESERVATION_ID int (11) NO PRI 0
USER_NAME varchar (255) YES NULL
PASSWORD varchar (255) YES NULL
EMAIL varchar (255) YES NULL
FIRSTNAME varchar (255) NO MUL
LASTNAME varchar (255) NO MUL
BIRTHDATE date YES
CONTACT_NO int (11) YES
ADDRESS varchar (255) YES
TRIP enum NO MUL

Page | 7
TERMINAL_ID int (11) NO MUL
BUS_ID int (11) NO MUL
BUS_TYPE enum NO MUL
SEAT_NO enum NO MUL
PLATE_NO varchar (255) NO MUL
AVAILABLE_SEATS int (11) NO MUL
DATE_OF_RESERVATION date YES NULL

In this table the user can see the details of the passenger and this is where the
passenger will be inputting information or data.

Database Schema of PASSENGER Table


Field Data Type Null Key Default
PID int (11) NO PRI
LASTNAME varchar (255) YES NULL
FIRSTNAME varchar (255) YES NULL
SEAT_NO enum YES NULL
BUS_ID int (11) YES MUL NULL
TERMINAL_ID int (11) YES MUL NULL
FARE_TYPE_ID int (11) YES MUL NULL

In this table the user can view the overall schema of the passengers

Database Schema of ROUTES Table


Field Data Type Null Key Default
ROUTE_ID int (11) NO PRI
ROUTE_NAME varchar (15) YES NULL
TERMINAL_ID int (11) YES MUL NULL
BUS_ID int (11) YES MUL NULL

In this figure the user can view the overall schema of the Routes and details also.

Database Schema of SCHEDULE table


Field Data Type Null Key Default
SID int (11) NO PRI
TRIP enum YES NULL
DATE_SCHEDULE date YES NULL

Page | 8
BUS_ID int (11) YES MUL NULL
TERMINAL_ID int (11) YES MUL NULL

In this figure the user can view the overall schema of the Schedule Table

Database Schema of TERMINAL Table


Field Data Type Null Key Default
TERMINAL_ID int (11) NO PRI
TERMINAL varchar (255) YES NULL

In this figure the user can view the overall database schema of the terminal

Database Schema of TRANSACTION Table


Field Data Type Null Key Default
TRANSACTION_ID int (11) NO PRI
TRANSACTION_DATE date YES NULL
ROUTE_ID int (11) NO MUL
TERMINAL_ID int (11) NO MUL
FARE_TYPE_ID int (11) NO MUL
BUS_ID int (11) NO MUL
PID int (11) NO MUL
FARE int (11) NO MUL

In this figure the user can view the overall database schema of the transaction

Page | 9
Relationships

In this figure shows the relationship of the Bus table to the Routes table, Schedule
table, Online Reservation table, Passenger table, and the Transaction table it has a one-to-
many relationship because of the foreign key originated to the Bus table.

Page | 10
In this figure show the relationship of the Passenger table to the Transaction table,
Schedule table, and the Fare Discount table. The Passenger has a one-to-many relationship
to the Transaction table and Fare Discount table while the transaction has a many-to-many
relationship to Schedule table.

Page | 11
Restrictions of the Database
 Creating a user:
CREATE USER ‘DB_Administrator’@’localhost’ IDENTIFIED BY
‘admin’;
CREATE USER ‘Dispatcher’@’localhost’ IDENTIFIED BY ‘
patcher’;
CREATE USER ‘Terminal_Staff’@’localhost’ IDENTIFIED BY
‘terminstaff’;
CREATE USER ‘Supervisor’@’localhost’ IDENTIFIED BY ‘visor’;
CREATE USER ‘HR_Manager’@’localhost’ IDENTIFIED BY
‘manager’;

 Revoking and Granting Privileges to the users:

Revoking and Granting Privileges on BUS Table


GRANT ALL ON Bus TO ‘DB_Adminitrator’@’localhost;
GRANT SELECT ON Bus TO ‘Dispatcher’@’localhost;
GRANT SELECT ON Bus TO ‘Terminal_Staff’@’localhost;
GRANT ALL ON Bus TO ‘Supervisor’@’localhost;
REVOKE INSERT, UPDATE, DELETE ON Bus TO
‘Dispatcher’@’localhost;
REVOKE INSERT, UPDATE, DELETE ON Bus TO
‘Terminal_Staff’@’localhost;

Page | 12
Revoking and Granting Privileges on DRIVER Table
GRANT ALL ON Driver TO ‘DB_Adminitrator’@’localhost;
GRANT SELECT ON Driver TO ‘Dispatcher’@’localhost;
GRANT SELECT ON Driver TO ‘Terminal_Staff’@’localhost;
GRANT ALL ON Driver TO ‘HR_Manager’@’localhost;
REVOKE INSERT, UPDATE, DELETE ON Driver TO
‘Dispatcher’@’localhost;
REVOKE INSERT, UPDATE, DELETE ON Driver TO
‘Terminal_Staff’@’localhost;

Revoking and Granting Privileges on TERMINAL Table


GRANT ALL ON Terminal TO ‘DB_Adminitrator’@’localhost;
GRANT SELECT ON Terminal TO ‘Dispatcher’@’localhost;
GRANT SELECT ON Terminal TO ‘Terminal_Staff’@’localhost;
GRANT ALL ON Terminal TO ‘Supervisor’@’localhost;
REVOKE INSERT, UPDATE, DELETE ON Terminal TO
‘Dispatcher’@’localhost;
REVOKE INSERT, UPDATE, DELETE ON Terminal TO
‘Terminal_Staff’@’localhost;

Revoking and Granting Privileges on SCHEDULE Table


GRANT ALL ON Schedule TO ‘DB_Adminitrator’@’localhost;
GRANT ALL ON Schedule TO ‘Dispatcher’@’localhost;
GRANT SELECT ON Schedule TO ‘Terminal_Staff’@’localhost;
GRANT ALL ON Schedule TO ‘Supervisor’@’localhost;
REVOKE INSERT, UPDATE, DELETE ON Schedule TO
‘Terminal_Staff’@’localhost;

Page | 13
Revoking and Granting Privileges on CONDUCTOR Table
GRANT ALL ON Conductor TO ‘DB_Adminitrator’@’localhost;
GRANT ALL ON Conductor TO ‘Supervisor’@’localhost;
GRANT SELECT ON Conductor TO ‘Terminal_Staff’@’localhost;
GRANT SELECT ON Conductor TO ‘Dispatcher’@’localhost;
REVOKE INSERT, UPDATE, DELETE ON Conductor TO
‘Terminal_Staff’@’localhost;
REVOKE INSERT, UPDATE, DELETE ON Conductor TO
‘Dispatcher’@’localhost;

Revoking and Granting Privileges on FARE Table


GRANT ALL ON Fare TO ‘DB_Adminitrator’@’localhost;
GRANT ALL ON Fare TO ‘Supervisor’@’localhost;
GRANT SELECT ON Fare TO ‘Terminal_Staff’@’localhost;
REVOKE INSERT, UPDATE, DELETE ON Fare TO
‘Terminal_Staff’@’localhost;

Revoking and Granting Privileges on ONLINE RESERVATION Table


GRANT ALL ON Online_Reservation TO
‘DB_Adminitrator’@’localhost;
GRANT ALL ON Online_Reservation TO ‘Supervisor’@’localhost;
GRANT ALL ON Online_Reservation TO ‘Terminal_Staff’@’localhost;

Revoking and Granting Privileges on TRANSACTION Table


GRANT ALL ON Transaction TO ‘DB_Adminitrator’@’localhost;
GRANT ALL ON Transaction TO ‘Supervisor’@’localhost;
GRANT ALL ON Transaction TO ‘Terminal_Staff’@’localhost;

Page | 14
Revoking and Granting Privileges on ROUTES Table
GRANT ALL ON Routes TO ‘DB_Adminitrator’@’localhost;
GRANT ALL ON RoutesTO ‘Supervisor’@’localhost;
GRANT SELECT ON Routes TO ‘Terminal_Staff’@’localhost;
GRANT SELECT ON Routes TO ‘Dispatcher’@’localhost;
REVOKE INSERT, UPDATE, DELETE ON Routes TO
‘Terminal_Staff’@’localhost;
REVOKE INSERT, UPDATE, DELETE ON Routes TO
‘Dispatcher’@’localhost;

Revoking and Granting Privileges on FARE TYPE Table


GRANT ALL ON Fare_Type TO ‘DB_Administrator’@’localhost;
GRANT ALL ON Fare_Type TO ‘Supervisor’@’localhost;
GRANT SELECT ON Fare_Type TO ‘Terminal_Staff’@’localhost;
REVOKE INSERT, UPDATE, DELETE ON Fare_type TO
‘Terminal_Staff’@’localhost;

Page | 15
Page | 16

You might also like