Hello.

I need to make a base in which there will be a description of the sessions in the cinema. Accordingly, I selected the following tables. But in this scheme I don’t like the fact that the session does not depend on the hall at all, and there is no possibility to limit the tickets for the session within the same hall. How can this be fixed?

alt text

    2 answers 2

    Worked in the cinema. ))
    Therefore, I will propose such a variant of determining the essence of the session - this is the period of time in which a certain film is being played in a certain hall (there may be several of them).

    Therefore, in the session you need to bind to the hall, in my opinion.

    Regarding the price - here it depends a lot on what - on the film itself (very good, very long), on the hall (Vip hall, regular hall), on the place in the hall - (center, sidewalls, etc.)

    Films are also better to throw in a separate table with the necessary attributes (duration, genre, title, etc. - this is what you need).

    But this is "... and there is no possibility to limit tickets for a session within the same hall." - do not quite understand what is meant by this?

    • And after the hall and session are contacted, a restriction of tickets for a session will be made fairly simple. In the current model, not a single ticket has been sold for the session, we cannot say in which hall it will be. And to sell a ticket, we can only in a specific room and a specific session. I don’t see at what point a ticket might appear :) - Zufir
    • And that is, the restriction on the tickets for the session implies whether the place is sold or not? - even more precisely whether it is possible to sell this place. ) - Ale_x

    just add the session id to the table with halls for one (or several) sessions more ... Plus, one ID will not change the weather. And it will be easier to get data when querying.