Professional Documents
Culture Documents
15
Shares
12
Subscribe
reservation_type
id int PK
reservation_type varchar(32)
reservation
seat_reserved
id int PK
screening_id int FK id int PK
employee employee_reserved_id int N FK seat_id int FK
reservation_type_id int N FK reservation_id int FK
id int PK reservation_contact varchar(1024) screening_id int FK
username varchar(32)
reserved bool N
password varchar(100) EDIT MODEL IN YOUR BROWSER
employee_paid_id int N FK
paid bool N
1 of 6 5/23/2018, 1:02 AM
How to Design a Database Model for a Movie Theater Reservation System http://www.vertabelo.com/blog/technical-articles/a-database-model-for-...
15
Shares
12
movie
id
title
duration_min
previous screening start time + duration_min of it > this screening start time
auditorium
seats_no
seat
seat
seats_no auditorium
screening
auditorium_id screening_start
movie_id auditorium_id
screening_start
-- Tables
-- Table screening
CREATE TABLE screening (
id int NOT NULL AUTO_INCREMENT,
movie_id int NOT NULL ,
auditorium_id int NOT NULL ,
screening_start timestamp NOT NULL ,
UNIQUE INDEX Screening_ak_1 (movie_id,auditorium_id,screening_start),
CONSTRAINT Screening_pk PRIMARY KEY (id)
2 of 6 5/23/2018, 1:02 AM
How to Design a Database Model for a Movie Theater Reservation System http://www.vertabelo.com/blog/technical-articles/a-database-model-for-...
);
seat
15
Shares
12
reservation_type
employee
reservation seat_reserved
reservation
reserved reservation_type_id
employee_reserved_id
id_employee
employee_paid_id
id_employee
seat_reserved
employee_reserved_id
reservation_type_id
3 of 6 5/23/2018, 1:02 AM
How to Design a Database Model for a Movie Theater Reservation System http://www.vertabelo.com/blog/technical-articles/a-database-model-for-...
reservation_contact
15
Shares employee_paid_id
12
paid
Follow @vertabelo
Like 12 Tweet
4 of 6 5/23/2018, 1:02 AM
How to Design a Database Model for a Movie Theater Reservation System http://www.vertabelo.com/blog/technical-articles/a-database-model-for-...
12
Should be
Also, what is your opinion on using NoSQL for storing half of the data like audi and it's seats
? Albeit, it will make more sense to have the reservation mechanism as relational because of
the nature of the data.
• Reply • Share ›
I wouldn't use NoSQL if not really needed here. If a relational model works fine I
would leave it that way and think of other options in case we have performance
issues.
• Reply • Share ›
VERTABELO
5 of 6 5/23/2018, 1:02 AM
How to Design a Database Model for a Movie Theater Reservation System http://www.vertabelo.com/blog/technical-articles/a-database-model-for-...
15
Shares
12
6 of 6 5/23/2018, 1:02 AM