Skip to content
Louvre Ops DB

View

slot_availability

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

Rows 1–25 of 443

slot_availability, page 1 of 18
slot_idINTEGERexhibition_idINTEGERtitleTEXTslot_dateTEXTstart_timeTEXTcapacityINTEGERbookedanyadmittedanyremainingany
11Treasures of the Royal Wardrobe2015-03-2311:00451144
21Treasures of the Royal Wardrobe2015-03-2312:30451044
31Treasures of the Royal Wardrobe2015-03-2314:00451044
41Treasures of the Royal Wardrobe2015-03-3115:45452243
51Treasures of the Royal Wardrobe2015-04-0412:00452243
61Treasures of the Royal Wardrobe2015-04-2511:304545410
71Treasures of the Royal Wardrobe2015-04-2511:4545131232
81Treasures of the Royal Wardrobe2015-05-2113:15451144
91Treasures of the Royal Wardrobe2015-05-2216:00453342
101Treasures of the Royal Wardrobe2015-05-2512:15455540
111Treasures of the Royal Wardrobe2015-05-2811:004545300
121Treasures of the Royal Wardrobe2015-05-2811:15452243
131Treasures of the Royal Wardrobe2015-06-0712:00452043
141Treasures of the Royal Wardrobe2015-06-1117:15451144
151Treasures of the Royal Wardrobe2015-06-1416:30455540
162Bronze and Fire: Renaissance Sculpture2015-09-2716:45402238
172Bronze and Fire: Renaissance Sculpture2015-10-0411:30402238
182Bronze and Fire: Renaissance Sculpture2015-10-0715:15402238
192Bronze and Fire: Renaissance Sculpture2015-10-1111:45404336
202Bronze and Fire: Renaissance Sculpture2015-10-2612:45402238
212Bronze and Fire: Renaissance Sculpture2015-10-3012:45401139
222Bronze and Fire: Renaissance Sculpture2015-11-0612:15401139
232Bronze and Fire: Renaissance Sculpture2015-11-1015:30403337
242Bronze and Fire: Renaissance Sculpture2015-11-1810:30404336
252Bronze and Fire: Renaissance Sculpture2015-11-1814:45401039
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;