0% found this document useful (0 votes)
97 views

Conceptual Design

The document outlines the requirement analysis, conceptual design, logical design, physical design, and security design for a railway booking system. The requirement analysis defines six entities - Customer, Train, Seats, Trips, Tickets, and Admin. The conceptual design shows the relationships between these entities. The logical design further defines the attributes for each entity. The physical design specifies the data types for each attribute. Finally, the security design outlines the access levels for different user roles.

Uploaded by

BASEERAT RAFIQ
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views

Conceptual Design

The document outlines the requirement analysis, conceptual design, logical design, physical design, and security design for a railway booking system. The requirement analysis defines six entities - Customer, Train, Seats, Trips, Tickets, and Admin. The conceptual design shows the relationships between these entities. The logical design further defines the attributes for each entity. The physical design specifies the data types for each attribute. Finally, the security design outlines the access levels for different user roles.

Uploaded by

BASEERAT RAFIQ
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

REQUIREMENT ANALYSIS:

This model is based on the working of Railway station. The model includes six entities. Each
entity will be working to store the data for the railway station. The customer entity will ask
for the c-id, c_name, c_contact, , email, password of the customer. The train entity will
contain train_id,train_number , train_name ,train_type ,departure_station and
arrival_station and so on.
The entities consist of:

Seats

Customer

Admin

Trips

Train

Tickets

Conceptual Design:

Customer Seats

Admin Trips

Train Tickets
Logical Design:

Customer Seats
cust_id seat_id
name train_id
email cust_id
password seat_n0
contact class

Admin Trips
ad_id trip_id
ad_email train_id
Train
ad_password cust_id
train_id
cust_id departure_date
train_number arrival_date
Tickets
train_name fare
ticket_id
train_type
trip_id
departure_station
seat_id
arrival_station
booking_date
booking_time
SCHEMA REFINING

Firstname Customer Seats


lastname cust_id seat_id
name train_id
email cust_id
password seat_n0
contact class

Admin Trips
a-date
ad_id trip_id a-month
a-year
ad_email train_id
Train_types Train
HazaraExpress ad_password cust_id
Mehran Express
Karachi Express
train_id
cust_id departure_date
train_number arrival_date
Tickets
train_name fare b-date
ticket_id
b-month
train_type
trip_id b-year
departure_station
seat_id
arrival_station
booking_date
booking_time
PHYSICAL DESIGN

Firstname Customer Seats

lastname cust_id (num) seat_id (num)


name (text) train_id (text)
email (text) cust_id (num)
password (text) seat_no (num)
contact (num) class (text)

Admin Trips
ad_id trip_id
ad_email (text) train_id
Train (text)
ad_password cust_id
train_id(num)
cust_id (text) departure_date
train_number (num) arrival_date
Tickets
train_name (text) b-date
ticket_idfare
(text)
b-month
train_type (text)
trip_id (text) b-year
departure_station(text)
seat_id (num)
arrival_station (text)
booking_date (text)
booking_time (text)
SECURITY DESIGN
User Ticket payment Reviews Profile

Employees W W R/W R/W

Customer R W W R/W

Admin W W R/W R/W

Stack holder Modules

SQL Queries:
create database RailwayBooking;
use RailwayBooking;

-- Users table
CREATE TABLE users (
user_id INT NOT NULL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
contact VARCHAR(255) NOT NULL
);

-- Trains table
CREATE TABLE trains (
train_id INT NOT NULL PRIMARY KEY,
train_number VARCHAR(255) NOT NULL UNIQUE,
train_name VARCHAR(255) NOT NULL,
train_type VARCHAR(255) NOT NULL,
departure_station VARCHAR(255) NOT NULL,
arrival_station VARCHAR(255) NOT NULL
);

-- Seats table
CREATE TABLE seats (
seat_id INT NOT NULL PRIMARY KEY,
train_id INT NOT NULL,
user_id INT,
seat_number VARCHAR(255) NOT NULL,
class VARCHAR(255) NOT NULL,
--is_reserved BOOLEAN DEFAULT false,
FOREIGN KEY (train_id) REFERENCES trains(train_id),
FOREIGN KEY (user_id) REFERENCES users(user_id)
);

-- Trips table
CREATE TABLE trips (
trip_id INT NOT NULL PRIMARY KEY,
train_id INT NOT NULL,
user_id INT NOT NULL,
departure_date DATE NOT NULL,
arrival_date DATE NOT NULL,
departure_time TIME NOT NULL,
arrival_time TIME NOT NULL,
fare DECIMAL(10, 2) NOT NULL,
FOREIGN KEY (train_id) REFERENCES trains(train_id),
FOREIGN KEY (user_id) REFERENCES users(user_id)
);

-- Ticket table
CREATE TABLE tickets (
ticket_id INT NOT NULL PRIMARY KEY,
trip_id INT NOT NULL,
seat_id INT NOT NULL,
booking_date DATE NOT NULL,
booking_time TIME NOT NULL,
FOREIGN KEY (trip_id) REFERENCES trips(trip_id),
FOREIGN KEY (seat_id) REFERENCES seats(seat_id)
);
/*------------Admin_Table--------------------------
create table Admin_Table(
ad_ID int identity primary key,
ad_email varchar(50) not null,
ad_password varchar (50) not null,
cust_ID int foreign key references Customer_Table (cust_ID)
);

insert into Admin_Table


values('amad', 'admin123')
insert into Admin_Table
values('hamyz', 'admin123')
insert into Admin_Table
values('esha', 'admin123')
insert into Admin_Table
values('nameer', 'admin123')*/
ERD:

You might also like