cgb
Tables (9)
Customer
- customer_id — INT — Primary key
- phone_number — VARCHAR(20) — NOT NULL
Employee
- employee_id — INT — Primary key
- screen_id — INT — Foreign key → Screen.screen_id
- seat_id — INT — Foreign key → Screen.seat_id
- name — VARCHAR(100) — NOT NULL
- contact — VARCHAR(50)
Movie
- movie_id — INT — Primary key
- title — VARCHAR(100) — NOT NULL
- start_date — DATE — NOT NULL
- end_date — DATE — NOT NULL
Reservation
- reservation_id — INT — Primary key
- screen_period_id — INT — NOT NULL
- seat_id — INT — NOT NULL
- customer_id — INT — NOT NULL
- screen_period_id (screen_period_id2) — INT — Foreign key → ScreenPeriod.screen_period_id
- seat_id (seat_id2) — INT — Foreign key → Seat.seat_id
- customer_id (customer_id2) — INT — Foreign key → Customer.customer_id
Screen
- screen_id — INT — Primary key
- seat_id — INT — Foreign key → Seat.seat_id
- name — VARCHAR(100)
- theater_id — INT — NOT NULL
- employee_id — INT — NOT NULL
- theater_id (theater_id2) — INT — Foreign key → Theater.theater_id
ScreenPeriod
- screen_period_id — INT — Primary key
- screen_id — INT — NOT NULL
- movie_id — INT — NOT NULL
- start_time — DATETIME — NOT NULL
- end_time — DATETIME — NOT NULL
- screen_id (screen_id2) — INT — Foreign key → Screen.screen_id
- seat_id — INT — Foreign key → Screen.seat_id
- movie_id (movie_id2) — INT — Foreign key → Movie.movie_id
Seat
- seat_id — INT — Primary key
- screen_id — INT — NOT NULL
- location — VARCHAR(10) — NOT NULL
- type — VARCHAR(20)
- price — INT — NOT NULL
Theater
- theater_id — INT — Primary key
- name — VARCHAR(100) — NOT NULL
Ticket
- ticket_id — INT — Primary key
- screen_period_id — INT — NOT NULL
- seat_id — INT — NOT NULL
- phone_number_masked — VARCHAR(20) — NOT NULL
- screen_period_id (screen_period_id2) — INT — Foreign key → ScreenPeriod.screen_period_id