Welcome to a sharing of an ERD of a movie booking system. So you are planning to build a system for a movie theater? Or maybe you are just stuck with this as a school project? Well, here’s a sharing of my “simple version”, hope it helps to speed up your design process. Read on!
TABLE OF CONTENTS
ER DIAGRAM
First, here is the entire ER diagram and a quick overview of the system.
MOVIE BOOKING SYSTEM ERD
To keep things simple, I have grouped this system into 4 sections.
- Users – The administrator, staff, and customers.
- Cinemas – Cinemas, theaters, seats.
- Movies – Captain Obvious at your service.
- Shows & Booking – Available screening times and booking.
FOR REFERENCE ONLY
I can hear the “master system builders” go – “This diagram is inaccurate”, “this is stupid”, and “this is too simple”. By all means, this is only a reference.
- Movies can have zero or many shows – Yes, movies can get canceled. If they HAVE to be screened at least once, go ahead and change this on your own.
- Movie theaters have multiple seats. If you have “special seatless theaters”, go ahead and change this on your own.
- If you are running outdoor movie theaters, go ahead and change the entire cinema/theater/seats section to your own – Maybe to just “theater and parking lots”.
- If you want to track monetary transactions, go ahead and add more tables/entities on your own.
The list can go on, but the point here is – You are creating your own system, you have to define your own rules.
TABLE STRUCTURE
Now that we are done with the overview, let us get into more details on the entities or tables.
PART 1) USERS
COLUMN | DATA TYPE | NOTES |
user_id | INTEGER | Primary key. |
user_role | VARCHAR | Up to you to decide – “A”dmin, “S”taff, “C”ustomer. |
user_name | VARCHAR | The user’s full name. |
user_email | VARCHAR | The user’s email. Unique to prevent duplicates. |
user_password | VARCHAR | The user’s password. |
Some beginners like to create multiple “user tables” – Customers, Staff, Managers, and Administrators. No idea why. If all of them share the same dataset, why not just create a single “users table with role field”?
PART 2) MOVIES
COLUMN | DATA TYPE | NOTES |
movie_id | INTEGER | Primary key. |
movie_name | VARCHAR | Name of the movie. |
movie_language | VARCHAR | The spoken language of the movie. |
movie_subtitles | VARCHAR | Available subtitles. |
movie_rating | VARCHAR | Not “number of stars”. “G”, “PG”, “NC16”, “M18”, “RA”, etc… |
Adding some information such as “synopsis” and “poster” may make sense for an online portal, but don’t go crazy otherwise. We are not building a movie database here – “Producer”, “studio”, “actors”, and “review” probably won’t make much sense.
PART 3) BRICKS & MOTAR
3A) CINEMAS
COLUMN | DATA TYPE | NOTES |
cinema_id | INTEGER | Primary key. |
cinema_name | VARCHAR | Name of the cinema. |
cinema_address | VARCHAR | Street address. |
cinema_tel | VARCHAR | Telephone number. |
cinema_email | VARCHAR | Email address. |
At the “top level”, we have the cinema itself – Which is the entire building.
3B) THEATERS
COLUMN | DATA TYPE | NOTES |
theater_id | INTEGER | Primary key. |
cinema_id | INTEGER | Foreign key. |
theater_name | VARCHAR | Name of the theater. Can be anything, maybe just numbers or even funky names – “T1, T2, T3, JUAN, DOS, TRES” |
Next, a cinema can have multiple theaters. I know, this may not be the case. But it’s always better to future-proof systems and keep this.
3C) SEATS
COLUMN | DATA TYPE | NOTES |
seat_id | VARCHAR | Primary key. |
theater_id | INTEGER | Primary and foreign key. |
seat_type | VARCHAR | Up to you to decide – Single, King, Double, Gold, etc… |
Finally, the seats of the theater. Take extra note – The seat ID is a VARCHAR, it can be a seat number such as “A1, B2, C3”. Things can get very complicated with the seat layout, I will leave it out of this simple ERD – It can be an entire sub-system on its own.
PART 4) SHOWS & BOOKING
4A) SHOWS
COLUMN | DATA TYPE | NOTES |
show_id | INTEGER | Primary key. |
movie_id | INTEGER | Foreign key. Which movie is playing. |
theater_id | INTEGER | Foreign key. At which theater. |
show_time | DATE TIME | At what time. |
Which movie is playing at which theater, and at what time?
4B) BOOKING
COLUMN | DATA TYPE | NOTES |
show_id | INTEGER | Primary and foreign key. |
user_id | INTEGER | Primary and foreign key. |
seat_id | INTEGER | Primary and foreign key. |
Which user (customer and possibly in-house staff) booked which movie, theater, and seat?
EXTRA
That’s all for the tutorial, and here is a small section on some extras and links that may be useful to you.
LINKS & REFERENCES
- Entity-Relationship Diagram Symbols and Notation – Lucid Chart
THE END
Thank you for reading, and we have come to the end. I hope that it has helped you to better understand, and if you want to share anything with this guide, please feel free to comment below. Good luck and happy coding!