This repository contains SQL scripts to create a basic railway database system. The system is designed to manage information related to trains, routes, passengers, tickets, and stations. The database schema includes tables for Train, Route, Passenger, Ticket, and Station, each serving a specific purpose within the railway system.
The railway database system allows for efficient management of:
- Train schedules
- Passenger bookings
- Route information
- Ticket reservations
- Station details
The database schema consists of the following tables:
Train: Information about trains, including departure and arrival details.Route: Details of train routes, including stations and stop order.Passenger: Passenger information with names.Ticket: Reservation details, including seat numbers and fares.Station: Information about railway stations.
The project includes SQL queries and stored procedures for various functionalities such as:
- Ticket booking and cancellation
- Train occupancy tracking
- Late train alerts
- Passenger count analysis
Triggers have been implemented to automate certain actions, including:
- Updating train occupancy after each ticket booking or cancellation.
- Alerting if a train is delayed beyond a specified threshold.
- Clone the repository:
git clone https://github.com/yourusername/railway-database.git - Import the SQL script to set up the database schema and initial data.
- Execute the provided queries, stored procedures, and triggers for desired functionalities.
The database can be utilized for various railway management tasks, such as:
- Booking and canceling tickets
- Analyzing passenger and train data
- Monitoring train occupancy and delays
Feel free to explore and customize the project based on your specific requirements.
Contributions are welcome! If you have any ideas, enhancements, or bug fixes, please open an issue or submit a pull request.
Email - thejasl1508@gmail.com LinkedIn - https://www.linkedin.com/in/thejas-narayan-06046b22b/