CGB
Tables (8)
Customer
- customer_id — SERIAL
- phone — VARCHAR(20)
Employee
- employee_id — SERIAL — Primary key
- name — VARCHAR(100)
- phone — VARCHAR(20)
Movie
- movie_id — SERIAL
- title — VARCHAR(255)
- start_date — DATE
- end_date — DATE
Screen
- screen_id — SERIAL
- theater_id — INT
- name — VARCHAR(50)
- employee_id — INT
ScreenPeriod
- screen_period_id — SERIAL
- screen_id — INT
- movie_id — INT
- start_time — TIMESTAMP
- end_time — TIMESTAMP
Seat
- seat_id — SERIAL
- screen_id — INT
- row — CHAR(1)
- number — INT
- location — VARCHAR(50)
- type — VARCHAR(50)
- price — DECIMAL(10,2)
- UNIQUE(screen_id, — row,
Theater
- employee_id — SERIAL — Foreign key → Employee.employee_id
- theater_id — SERIAL
- name — VARCHAR(100)
- location — TEXT
Ticket
- ticket_id — SERIAL
- customer_id — INT
- screen_period_id — INT
- seat_id — INT
- purchased_at — TIMESTAMP