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

CREATE TABLE Users (

Uploaded by

Abhishek nair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

CREATE TABLE Users (

Uploaded by

Abhishek nair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

CREATE TABLE users (

user_Id INT PRIMARY KEY AUTO_INCREMENT,


username VARCHAR(50) NOT NULL,
password VARCHAR(50) NOT NULL
);

CREATE TABLE trains (


train_id INT PRIMARY KEY AUTO_INCREMENT,
train_name VARCHAR(100),
source VARCHAR(50),
destination VARCHAR(50),
departure_time DATETIME,
arrival_time DATETIME
);

CREATE TABLE coaches (


coach_id INT PRIMARY KEY AUTO_INCREMENT,
train_id INT,
coach_type VARCHAR(20),
available_seats INT,
FOREIGN KEY (train_id) REFERENCES trains(train_id)
);

CREATE TABLE reservations (


reservation_id INT PRIMARY KEY AUTO_INCREMENT,
user_name VARCHAR(50),
passenger_name VARCHAR(50),
age INT,
gender VARCHAR(10),
train_id INT,
coach_type VARCHAR(20),
seat_number INT,
departure_city VARCHAR(50),
arrival_city VARCHAR(50),
status VARCHAR(20),
meal_option VARCHAR(20),
ticket_price DECIMAL(10, 2),
FOREIGN KEY (train_id) REFERENCES trains(train_id)
);

INSERT INTO users (username, password) VALUES ('Admin', 'Admin_6789'), ('Admin2',


'Admin_1234');

INSERT INTO trains (train_name, source, destination, departure_time, arrival_time)


VALUES
(110256, 'Rajdhani Express', 'Ankleshwar', 'Delhi', '2025-04-20 06:00:00', '2025-
04-22 15:00:00'),
(652319, 'Satabdhi Express', 'Ankleshwar', 'Delhi', '2025-04-20 09:00:00', '2025-
04-22 18:00:00'),
(259032, 'Vandehbharat', 'Kochi', 'Shimla', '2025-05-01 08:00:00', '2024-05-4
17:30:00'),
(782195, 'Malabar Express', 'Kochi', 'Shimla', '2025-05-01 04:00:00', '2024-05-4
13:30:00'),
(378149, 'Duronto Express', 'Lucknow', 'Chennai ', '2025-01-20 10:00:00', '2025-01-
22 19:00:00'),
(105693, 'Rajdhani Express', 'Lucknow', 'Chennai ', '2025-01-20 14:00:00', '2025-
01-22 23:00:00'),
(411905, 'Omkar Express', 'jodhpur ', 'Bangalore', '2025-02-27 05:30:00', '2025-03-
02 09:30:00');
(349907, 'KSR bengluru double Decker', 'jodhpur ', 'Bangalore', '2025-02-27
03:30:00', '2025-03-02 07:30:00');

INSERT INTO coaches (train_id, coach_type, available_seats) VALUES


(110256, 'Sleeper', 150, 50),
(110256, 'AC', 100, 20),
(652319, 'Sleeper', 162, 34),
(652319, 'AC', 50, 36);
(259032, 'Sleeper', 180, 70),
(259032, 'AC', 120, 30),
(782195, 'Sleeper', 130, 60),
(782195, 'AC', 100, 40);
(378149, 'Sleeper', 200, 90),
(378149, 'AC', 150, 50),
(105693, 'Sleeper', 190, 70),
(105693, 'AC', 130, 60);
(411905, 'Sleeper', 180, 60),
(411905, 'AC', 130, 40),
(349907, 'Sleeper', 120, 40),
(349907, 'AC', 110, 35);

You might also like