Forum

Posted by Bhumin, March 21, 2022, 10:35 a.m.

#52

Hello everyone!

I might be missing out something major in this question. Wondering about this solution given the problem is to find film_id with actors that has never appeared on tv.

Problem statement:

  • Write a query to return the film_id with movie only casts (actors who never appeared in tv).
  • The order of your results doesn't matter.
  • You should exclude movies with one or more tv actors

My solution:

select distinct(film_id)
from film_actor
where actor_id not in (select actor_id from actor_tv) 

This question is closed

Answers

You're on the right track, but there's some nuance here that your query doesn't cover. Consider what this query would return if there are two actors in the film, one who starred in TV and one who did not. While the film_id wouldn't return for the actor that was on TV, it would return for the film-only actor. You need to determine a method to filter out film_ids where anyone in the cast also appeared on TV.

👍

Leon, March 21, 2022, 2:57 p.m.

Thank you, Mike. It makes sense now.

Bhumin, March 21, 2022, 7:19 p.m.
SQLPad user avatar

Mike (228)

March 21, 2022, 1 p.m.

Like @mike said, there are some trivial/tricky parts in this question. : )

SQLPad user avatar

Leon (949)

March 21, 2022, 3:31 p.m.