Skip to content
Louvre Ops DB

View

slot_availability

Booked, admitted and remaining places for every dated slot. Replaces the stored 2020 count.

Rows 76–100 of 443

slot_availability, page 4 of 18
slot_idINTEGERexhibition_idINTEGERtitleTEXTslot_dateTEXTstart_timeTEXTcapacityINTEGERbookedanyadmittedanyremainingany
765Scribes of the Nile2016-10-1213:15452143
775Scribes of the Nile2016-10-1815:00454441
785Scribes of the Nile2016-10-2617:15452143
795Scribes of the Nile2016-11-2416:00451144
805Scribes of the Nile2016-11-2612:45454441
815Scribes of the Nile2016-12-1509:45453342
825Scribes of the Nile2016-12-2815:30452243
835Scribes of the Nile2017-01-0611:15453242
845Scribes of the Nile2017-01-0709:45451144
856Light on the Water: Venetian Views2017-02-2216:00354331
866Light on the Water: Venetian Views2017-02-2317:15351034
876Light on the Water: Venetian Views2017-02-2612:00351134
886Light on the Water: Venetian Views2017-02-2715:45353232
896Light on the Water: Venetian Views2017-02-2812:15351134
906Light on the Water: Venetian Views2017-03-0611:30351134
916Light on the Water: Venetian Views2017-03-1013:45352033
926Light on the Water: Venetian Views2017-03-1112:45354431
936Light on the Water: Venetian Views2017-03-1212:45351134
946Light on the Water: Venetian Views2017-03-1412:153535290
956Light on the Water: Venetian Views2017-03-1412:30355530
966Light on the Water: Venetian Views2017-03-1512:003535320
976Light on the Water: Venetian Views2017-03-1512:1535141421
986Light on the Water: Venetian Views2017-03-1516:00355530
996Light on the Water: Venetian Views2017-03-1615:00353232
1006Light on the Water: Venetian Views2017-03-1813:15351134
View definition
CREATE VIEW slot_availability AS
SELECT
  s.slot_id,
  s.exhibition_id,
  e.title,
  s.slot_date,
  s.start_time,
  s.capacity,
  count(b.booking_id)              AS booked,
  count(h.scan_id)                 AS admitted,
  s.capacity - count(b.booking_id) AS remaining
FROM exhibition_slot s
JOIN exhibition e ON e.exhibition_id = s.exhibition_id
LEFT JOIN exhibition_booking b ON b.slot_id = s.slot_id
LEFT JOIN hall_napoleon_scan h ON h.booking_id = b.booking_id
GROUP BY s.slot_id;