The document describes creating and populating two database tables (Trains and Passengers) using SQL commands and relating the tables. It creates the tables with primary keys, inserts sample records using both the datasheet view and SQL commands, updates and deletes records with conditions, alters the table structure, and joins the tables to display related records ordered by a field.
The document describes creating and populating two database tables (Trains and Passengers) using SQL commands and relating the tables. It creates the tables with primary keys, inserts sample records using both the datasheet view and SQL commands, updates and deletes records with conditions, alters the table structure, and joins the tables to display related records ordered by a field.
The document describes creating and populating two database tables (Trains and Passengers) using SQL commands and relating the tables. It creates the tables with primary keys, inserts sample records using both the datasheet view and SQL commands, updates and deletes records with conditions, alters the table structure, and joins the tables to display related records ordered by a field.
The document describes creating and populating two database tables (Trains and Passengers) using SQL commands and relating the tables. It creates the tables with primary keys, inserts sample records using both the datasheet view and SQL commands, updates and deletes records with conditions, alters the table structure, and joins the tables to display related records ordered by a field.
Pass_Id int, Train_No varchar(255), Journey_Date varchar(255), PRIMARY KEY (Pass_Id) ); 3. Insert 3 records using datasheet view in one table and 3 records using sql command in another table.
--Insert values to Train table
INSERT INTO Trains VALUES (1234, 'Duranto Express', 'Mumbai'); INSERT INTO Trains VALUES (2368, 'Sabarmati Express', 'Delhi'); INSERT INTO Trains VALUES (3689, 'Rajdhani Express', 'Banglore');
-- fetch some values
SELECT * FROM Trains WHERE Route = 'Mumbai'; SELECT * FROM Trains WHERE Route = 'Delhi'; SELECT * FROM Trains WHERE Route = 'Banglore';
Insert values to Passenger table
-- insert some values INSERT INTO Passenger VALUES (1, '1234', '18/01/2023'); INSERT INTO Passenger VALUES (2, '2368', '19/01/2023'); INSERT INTO Passenger VALUES (3, '3689', '20/01/2023');
-- fetch some values
SELECT * FROM Passenger WHERE Journey_Date = '18/01/2023'; SELECT * FROM Passenger WHERE Journey_Date = '19/01/2023'; SELECT * FROM Passenger WHERE Journey_Date = '20/01/2023'; 4. Create relationship between tables. SELECT Trains.Train_No, Passenger.Pass_Id, Trains.Route FROM Trains INNER JOIN Passenger ON Trains.Train_No=Passenger.Pass_Id;
Neues verkehrswissenschaftliches Journal - Ausgabe 26: User-based Adaptable High Performance Simulation Modelling and Design for Railway Planning and Operations