Posted by AR, Dec. 2, 2021, 6:58 p.m.
Question 32 Unpopular Movies
Question 32 asks to Write a query to return the number of films with no rentals in Feb 2020.
I took a look at the solution and understand the logic. The logic I used approached it from the opposite angle. I filtered to inventory which wasn't rented in Feb 2020 and try to count all the distinct film ids. Why does the following approach not work?
select count( distinct film_id)
from inventory
where inventory_id in (select inventory_id
from rental
where date(rental_ts) < '2020-02-01'
or date(rental_ts) > '2020-02-29')
I took a look at the solution and understand the logic. The logic I used approached it from the opposite angle. I filtered to inventory which wasn't rented in Feb 2020 and try to count all the distinct film ids. Why does the following approach not work?
select count( distinct film_id)
from inventory
where inventory_id in (select inventory_id
from rental
where date(rental_ts) < '2020-02-01'
or date(rental_ts) > '2020-02-29')