CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
🌙☀️
Log inStart free
Home/Templates/Student Projects (College Reports)

🎓 Student Projects (College Reports) · Database ERD

Railway Reservation System ER Diagram

The database of a railway reservation system: trains, coaches and seats, stations and routes, passengers, bookings with a PNR, tickets, payments, cancellations and refunds.

More Student Projects (College Reports) templates

Opening a template is free and never counts toward your daily diagrams. Asking the AI to change it counts as one.

Drawing diagram…

What this diagram shows

  • Route stops ordered per train with arrival and departure
  • Ticket status: confirmed, RAC or waiting list
  • Cancellations trigger refunds

Prompt used

ER diagram for a railway reservation system: trains with coaches and seats, stations, routes as an ordered list of stations per train with arrival and departure times, passengers, bookings with a PNR for a journey date, tickets per passenger with seat and status (confirmed, RAC, waiting list), payments, and cancellations with refunds.

Mermaid code
erDiagram
    TRAIN ||--o{ COACH : "configures"
    TRAIN ||--o{ ROUTE_STATION : "runs_along"
    TRAIN ||--o{ BOOKING : "scheduled_for"
    STATION ||--o{ ROUTE_STATION : "located_at"
    COACH ||--o{ SEAT : "contains"
    PASSENGER ||--o{ BOOKING : "initiates"
    BOOKING ||--o{ TICKET : "issues"
    BOOKING ||--o{ PAYMENT : "settled_by"
    SEAT ||--o| TICKET : "assigned_to"
    TICKET ||--o| CANCELLATION : "cancelled_via"
    PAYMENT ||--o| REFUND : "processes"
    CANCELLATION ||--o| REFUND : "triggers"

    TRAIN {
        uuid id PK
        string train_number
        string train_name
        string train_type
        timestamp created_at
    }
    STATION {
        uuid id PK
        string station_code
        string station_name
        string city
        timestamp created_at
    }
    ROUTE_STATION {
        uuid id PK
        uuid train_id FK
        uuid station_id FK
        integer stop_sequence
        string scheduled_arrival
        string scheduled_departure
    }
    COACH {
        uuid id PK
        uuid train_id FK
        string coach_code
        string coach_class
        int total_seats
    }
    SEAT {
        uuid id PK
        uuid coach_id FK
        string seat_number
        string berth_type
    }
    PASSENGER {
        uuid id PK
        string full_name
        integer age
        string gender
        string identity_number
        timestamp created_at
    }
    BOOKING {
        uuid id PK
        uuid passenger_id FK
        uuid train_id FK
        string pnr_number
        date journey_date
        string booking_status
        timestamp created_at
    }
    TICKET {
        uuid id PK
        uuid booking_id FK
        uuid seat_id FK
        string passenger_name
        string ticket_status
        decimal fare_amount
    }
    PAYMENT {
        uuid id PK
        uuid booking_id FK
        string transaction_reference
        decimal total_amount
        string payment_status
        timestamp payment_time
    }
    CANCELLATION {
        uuid id PK
        uuid ticket_id FK
        string cancellation_reason
        decimal fee_deducted
        timestamp cancelled_at
    }
    REFUND {
        uuid id PK
        uuid payment_id FK
        uuid cancellation_id FK
        decimal refund_amount
        string refund_status
        timestamp processed_at
    }

Inside this diagram

An entity relationship diagram with 11 tables, 61 columns and 12 relationships.

Tables and their columns

  • TRAIN: id (PK), train_number, train_name, train_type, created_at
  • COACH: id (PK), train_id (FK), coach_code, coach_class, total_seats
  • ROUTE_STATION: id (PK), train_id (FK), station_id (FK), stop_sequence, scheduled_arrival, scheduled_departure
  • BOOKING: id (PK), passenger_id (FK), train_id (FK), pnr_number, journey_date, booking_status, created_at
  • STATION: id (PK), station_code, station_name, city, created_at
  • SEAT: id (PK), coach_id (FK), seat_number, berth_type
  • PASSENGER: id (PK), full_name, age, gender, identity_number, created_at
  • TICKET: id (PK), booking_id (FK), seat_id (FK), passenger_name, ticket_status, fare_amount
  • PAYMENT: id (PK), booking_id (FK), transaction_reference, total_amount, payment_status, payment_time
  • CANCELLATION: id (PK), ticket_id (FK), cancellation_reason, fee_deducted, cancelled_at
  • REFUND: id (PK), payment_id (FK), cancellation_id (FK), refund_amount, refund_status, processed_at

Relationships

  • TRAIN configures COACH: each TRAIN has zero or more COACH, each COACH belongs to exactly one TRAIN
  • TRAIN runs_along ROUTE_STATION: each TRAIN has zero or more ROUTE_STATION, each ROUTE_STATION belongs to exactly one TRAIN
  • TRAIN scheduled_for BOOKING: each TRAIN has zero or more BOOKING, each BOOKING belongs to exactly one TRAIN
  • STATION located_at ROUTE_STATION: each STATION has zero or more ROUTE_STATION, each ROUTE_STATION belongs to exactly one STATION
  • COACH contains SEAT: each COACH has zero or more SEAT, each SEAT belongs to exactly one COACH
  • PASSENGER initiates BOOKING: each PASSENGER has zero or more BOOKING, each BOOKING belongs to exactly one PASSENGER
  • BOOKING issues TICKET: each BOOKING has zero or more TICKET, each TICKET belongs to exactly one BOOKING
  • BOOKING settled_by PAYMENT: each BOOKING has zero or more PAYMENT, each PAYMENT belongs to exactly one BOOKING
  • SEAT assigned_to TICKET: each SEAT has zero or one TICKET, each TICKET belongs to exactly one SEAT
  • TICKET cancelled_via CANCELLATION: each TICKET has zero or one CANCELLATION, each CANCELLATION belongs to exactly one TICKET
  • PAYMENT processes REFUND: each PAYMENT has zero or one REFUND, each REFUND belongs to exactly one PAYMENT
  • CANCELLATION triggers REFUND: each CANCELLATION has zero or one REFUND, each REFUND belongs to exactly one CANCELLATION

Make your own diagram like this

Describe your own system in plain English and the AI ER diagram generator draws it in seconds, in the same style as this template.

Related templates

Use CaseStudent Projects (College Reports)

Library Management System Use Case Diagram

Who uses a college library system and what each of them can do: members, the librarian and the system administrator.

Database ERDStudent Projects (College Reports)

Library Management System ER Diagram

The database of a library system: books and their copies, authors, members, loans, reservations and fines, with keys and cardinality.

Data FlowStudent Projects (College Reports)

Library Management System Data Flow Diagram (Level 1)

How data moves through a library system: members and the librarian, the main processes, and the data stores they read and write.

Class UMLStudent Projects (College Reports)

Library Management System Class Diagram

The main classes of a library system with attributes, methods and UML relationships.

SequenceStudent Projects (College Reports)

Library Management System Sequence Diagram (Issue a Book)

The steps when a member borrows a book: checks, loan record and the copy status update.

Use CaseStudent Projects (College Reports)

Online Examination System Use Case Diagram

What students, examiners and the administrator do in an online examination system.