Search…
Theater Lowest Capacity
Now that we have movie times from the API, we want to make sure we won't be crowded in with everyone else. Let’s use past ticket sales and capacity data to find the theater with the lowest occupancy.
1
WITH private_ryan AS (
2
SELECT *
3
FROM api.movietimes
4
WHERE movie='Saving Private Ryan' AND city='Las Vega, NV'
5
),
6
cinema_ref AS (
7
SELECT CAST(cinema_code AS INT) AS cc_int, CAST(occu_perc AS DOUBLE) AS occu_perc_d, *
8
FROM kaggle.moviefiles.`/cinemaTicket_Ref.csvh`
9
WHERE occu_perc <> ''
10
)
11
SELECT *
12
FROM private_ryan
13
INNER JOIN cinema_ref ON private_ryan.theater_code = cinema_ref.cc_int
14
ORDER BY cinema_ref.occu_perc_d ASC
15
LIMIT 1000
Copied!
Last modified 4mo ago
Export as PDF
Copy link