Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/03/2024 in all areas

  1. @gizmola With my model you would need to bring the ticket date into the equation SELECT s.id, s.row, s.seat_no FROM seat s LEFT JOIN booking b ON b.seat_id = s.id AND b.screening_id = 35 AND B.ticket_date = '2024-01-03' -- also required WHERE s.screen_id = 1 AND b.id IS NULL; As it is, a screening record states that the movie will be screened at time T each day between X and Y. On reflection, although requiring more rows, it would be better to have a screening record for every individual screening, giving... then your query would work as it is. Alternatively, to get vacant seats for a screening (and only requiring the screening id as input - if the screening id is known then the screen id is also known) you could SELECT s.id, s.row, s.seat_no FROM screening sg JOIN seat s ON sg.screen_id = s.screen_id LEFT JOIN booking b ON b.screening_id = sg.id AND b.seat_id = s.id WHERE sg.id = 35 AND b.id IS NULL
    1 point
This leaderboard is set to New York/GMT-04:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.