programming-examples/sql/SQLMovieDatabase/41. Write a query in SQL to find the name of those movies where one or more actors acted in two or more movies.sql

13 lines
418 B
MySQL
Raw Normal View History

2019-11-18 14:05:53 +01:00
/*41. Write a query in SQL to find the name of those movies where one or more actors acted in two or more movies. */
SELECT mov_title
FROM movie
WHERE mov_id IN (
SELECT mov_id
FROM movie_cast
WHERE act_id IN (
SELECT act_id
FROM actor
WHERE act_id IN (
SELECT act_id
FROM movie_cast GROUP BY act_id
HAVING COUNT(act_id)>1)));