Diffcult SQL Challenge: Using NOT IN

365 Days of Daily Coding: Day 70

Happy International Women’s Day to all the wonderful and godgeous women out there. Know that you are beautiful, you are a star and you are needed. The universe sends its love to you if you are reading this. All you need to do is claim it. Say yes to the love and energy.

So much for the optimism today. I am extremely happy that I managed to get most of my to-do-list done today except two from the list which I will be working on after this. I also solved this difficult challenge under an hour which is a massive improvement.

Difficult SQL Challenge:

WITH temp AS 
(SELECT DISTINCT f.film_id
FROM film_actor f JOIN actor_tv a
ON f.actor_id = a.actor_id
ORDER BY f.film_id)

SELECT film_id 
FROM film
WHERE film_id NOT IN
(SELECT film_id
FROM temp);

One response to “Diffcult SQL Challenge: Using NOT IN”

  1. Happy International Women’s Day to you too Karma! 🙂

    Like

Leave a reply to Eunice GM Cancel reply