Write a SQL Query to find the movie_title and name of director (first and last names combined) who directed a movie that casted a role as ‘SeanMaguire’.
Output Schema:
director_name,movie_title
NOTE:
- Output column name has to match the given output schema.
- Any name is the concatenation(without any delimiter) of first and last name if present
- (E.g. if director_first_name is ‘Alfred’ and director_last_name is ‘Hitchcock’ then director_name is ‘AlfredHitchcock’)
Example Output:
director_name,movie_title
AlfredHitchcock,Vertigo
Solutions:
- select CONCAT(TRIM(directors.director_first_name), TRIM(directors.director_last_name))
- as director_name ,movie_title
- from (((directors inner join movies_directors
- on directors.director_id=movies_directors.director_id)inner join
- movies on movies.movie_id=movies_directors.movie_id)inner join
- movies_cast on movies.movie_id=movies_cast.movie_id) where
- movies_cast.role='SeanMaguire';
Thank You
Comments
Post a Comment