Question

I have a table for a movie theater. It should contain some info when is it occupied by a movie projection. I am thinking of a 2-dimensional array - for each day in the week and each hour of the day a boolean cell indicating whether or not a projection is taking place at that theater at the given time.

I'm a beginner. Been working on Workbench only, no manually written code.

(The database is part of a larger project for website using PHP and JS.)

Was it helpful?

Solution

Personally I would go for the following approach:

  • a table movie_theater with all info about the movie theater (id, name, etc etc)
  • a table movie that holds all the movies that can be shown
  • a table projection that links a movie to a movie_theater and has a begin and end time_stamp

this way a projection is linked to a movie_theater and a movie. When generating a time table for a certain period you simply select all projections from a certain movie_theater from inbetween the given timestamps

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top