π΅ 1. Movie
Represents information about a movie.
| Field | Type | Description |
|---|---|---|
| MovieID (PK) | int | Unique identifier for each movie |
| Title | varchar(256) | Title of the movie |
| Description | varchar(512) | Summary of the movie |
| Duration | datetime | Length of the movie |
| Language | varchar(16) | Language of the movie |
| ReleaseDate | datetime | Release date |
| Country | varchar(64) | Country of origin |
| Genre | varchar(20) | Genre (e.g., action, drama) |
π One Movie can have multiple Shows.
π΅ 2. Show
Represents a particular showtime of a movie in a specific hall.
| Field | Type | Description |
|---|---|---|
| ShowID (PK) | int | Unique identifier |
| Date | datetime | Date of the show |
| StartTime | datetime | Start time |
| EndTime | datetime | End time |
| CinemaHallID (FK) | int | Which hall it's being shown in |
| MovieID (FK) | int | Which movie is being shown |
π Each Show belongs to one Movie and one Hall, but a movie can have many shows.
π΅ 3. Booking
A customer booking one or more seats for a specific show.
| Field | Type | Description |
|---|---|---|
| BookingID (PK) | int | Unique identifier |
| NumberOfSeats | int | How many seats were booked |
| Timestamp | datetime | When the booking was made |
| Status | int (enum) | Status: booked, cancelled, etc. |
| UserID (FK) | int | Who made the booking |
| ShowID (FK) | int | For which show |
π One Booking belongs to one User and one Show.
π΅ 4. User
Represents a person using the system to book tickets.
| Field | Type | Description |
|---|---|---|
| UserID (PK) | int | Unique identifier |
| Name | varchar(64) | User's name |
| Password | varchar(20) | Login password (likely hashed) |
| varchar(64) | Email address | |
| Phone | varchar(16) | Phone number |
π One User can make multiple Bookings.
π΅ 5. Payment
Represents the payment made for a booking.
| Field | Type | Description |
|---|---|---|
| PaymentID (PK) | int | Unique identifier |
| Amount | number | Amount paid |
| Timestamp | datetime | When the payment was made |
| DiscountCouponID | int | (Optional) coupon applied |
| RemoteTransactionID | int | External payment gateway reference |
| PaymentMethod | int (enum) | Enum like: Card, UPI, Wallet, etc. |
| BookingID (FK) | int | Linked booking |
π Each Payment is linked to one Booking.
π΅ 6. Show_Seat
Represents a seat reserved for a particular show.
| Field | Type | Description |
|---|---|---|
| ShowSeatID (PK) | int | Unique identifier |
| Status | int (enum) | Enum (available, booked, etc.) |
| Price | number | Dynamic price per seat |
| CinemaSeatID (FK) | int | Link to base seat |
| ShowID (FK) | int | For which show |
| BookingID (FK) | int | Which booking owns it (nullable) |
π A Show_Seat is derived from a Cinema_Seat and linked to a Booking and Show.
π΅ 7. Cinema_Seat
Represents a physical seat in a hall.
| Field | Type | Description |
|---|---|---|
| CinemaSeatID (PK) | int | Unique ID for the seat |
| SeatNumber | int | Seat number |
| Type | int (enum) | Enum: regular, recliner, etc. |
| CinemaHallID (FK) | int | In which hall |
π Each seat belongs to a Cinema Hall.
π΅ 8. Cinema_Hall
Represents an individual hall inside a cinema.
| Field | Type | Description |
|---|---|---|
| CinemaHallID (PK) | int | Unique ID |
| Name | varchar(64) | Hall name |
| TotalSeats | int | Number of seats |
| CinemaID (FK) | int | Which cinema it belongs to |
π One Cinema can have many Halls.
π΅ 9. Cinema
Represents a cinema (like PVR, INOX).
| Field | Type | Description |
|---|---|---|
| CinemaID (PK) | int | Unique ID |
| Name | varchar(64) | Cinema name |
| TotalCinemaHalls | int | Number of halls inside |
| CityID (FK) | int | Location city |
π A city can have multiple Cinemas.
π΅ 10. City
Location metadata for the cinema.
| Field | Type | Description |
|---|---|---|
| CityID (PK) | int | Unique city ID |
| Name | varchar(64) | City name |
| State | varchar(64) | State |
| ZipCode | varchar(16) | Postal code |
π Summary of Relationships:
- Movie β Show: One-to-many
- Show β Booking: One-to-many
- User β Booking: One-to-many
- Booking β Payment: One-to-one
- Show β Show_Seat: One-to-many
- Show_Seat β Booking: Many-to-one (nullable)
- Cinema β Cinema_Hall: One-to-many
- Cinema_Hall β Cinema_Seat: One-to-many
- City β Cinema: One-to-many
- Cinema_Hall β Show: One-to-many
β Use Case Example (Real Flow):
- A user logs in and selects a city.
- System shows cinemas in that city.
- User selects a cinema, chooses a movie and a showtime.
- Based on selected show, the system displays available seats from
Show_Seat. - User selects seats β makes a booking β payment is made and logged.
-
Show_Seat.statusis updated to booked andBookingIDis attached.
Top comments (0)