Posted by Sampada, Nov. 11, 2023, 11:05 p.m.
question no 42 solution
WITH my_cte AS
(SELECT f.film_id ,
case
WHEN COUNT(i. inventory_id ) > 0 THEN " in stock"
WHEN COUNT(i. inventory_id ) =0 THEN " not in stock"
END in_stock
FROM film AS f
LEFT JOIN inventory AS i
ON f.film_id = i. film_id
GROUP BY f.film_id,f.title)
SELECT in_stock, COUNT(*)
FROM my_cte
group by in_stock
I solved the question no 42 with above query and getting exact results however it is still not showing me marke as correct