WHAT TYPICAL MOVIE OF DIFFERENT TYPE PEOPLE WOULD LOVE TO SEE ON SPECIAL DAYS OR IN DIFFERENT SEASON?
MAT 259, 2020
Lu Ye
Concept
People might rent dvds and see movies to commemorate something, especially on special days, such as New Year, Valentine's Day, Easter, Christmas, and so on. I want to explore if people would love to see different kind movie on special day. I filtered out popular films(top 10 ) for each type of films from the dataset of most popular films in Seattle library and figure out the pattern of days that typical movies of different type was out of library.
Query
SELECT
title, date, COUNT(date) AS Counts, MIN(duration) AS day
FROM
(
SELECT
title, DATE(cout) AS date,
TIMESTAMPDIFF(HOUR, cout, cin) / 24.0 AS duration
FROM
spl_2016.inraw
WHERE
itemtype like 'acdvd' AND
( title like "Into the wild" OR
title like "Burn after reading" OR
title like "Michael Clayton" OR
title like "No country for old men" OR
title like "reader" OR
title like "Atonement" OR
title like "Doubt" OR
title like "curious case of Benjamin Button" OR
title like "Slumdog millionaire" OR
title like "Vicky Cristina Barcelona" OR…
)
GROUP BY date, title, duration
) AS charts
GROUP BY title, date, days
ORDER BY Counts DESC
Preliminary sketches
Process
Here we could see that people prefered to rent comedy and action movies on the last day of a year, romance and comedy movie on Valentine's day.
Final result
Code