Data Normalisation
Where you state:
"Show" should hold theater_name and title of the movie.
Consider normalising your data such that information pertaining to each distinct entity is held in a single table containing only a single instance of such entity.
For example, information pertaining to a movie (including its title) would be stored in the Movies
table, and only in this table. Information pertaining to a theatre would be stored in the Theatres
table and only in this table.
Each record in the Movies
and Theatres
tables would then be uniquely referenced using a separate primary key field (e.g. Movie_ID
and Theatre_ID
), for which I would recommend using a Long Integer Autonumber field.
From there on, whenever referencing a movie or a theatre in other tables, you would use only the relevant ID, and not carry across any other information.
Not only does this optimise the size & performance of your database (since integers occupy significantly less memory and can be indexed far more efficiently than strings), but you also need only maintain the data in a single location: if the name of a movie changes, you only need to change the data in the Movies
table, and this will be automatically reflected by any query which references this table.
Junction Tables
To answer your question regarding how to represent the showing of movies in multiple theatres, with multiple theatres also showing the same movie: this many-to-many relationship requires the use of a junction table, also known as a transaction table, bridge table, link table, and many other names besides.
Such table provides a junction at which the Movies
& Theatres
table meet.
Bearing in mind the above advice concerning data normalisation, such a junction table should only include the unique ID for each Movie & Theatre, not the theatre name or movie title.
For example, such a table might look this like:
+------------+------------+----------+
| Showing_ID | Theatre_ID | Movie_ID |
+------------+------------+----------+
| 1 | 1 | 2 |
| 2 | 1 | 3 |
| 3 | 2 | 1 |
| ... | ... | ... |
+------------+------------+----------+