Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Schema: the table movies with key movie_id, the table people with key person_id, and the table genres with key genre_id. The table has_genre implements a
Schema: the table movies with key movie_id, the table people with key person_id, and the table genres with key genre_id. The table has_genre implements a relationship between movies and genres and has the key (movie_id, genre_id). The table plays_role implements a relationship between movies and people and has the key (movie_id, person_id, role). Question 7 Complete the following SQL so that it returns records of the form: pid1, pid2, movie_id where pid1 and pid2 are identifiers of co-actors with roles in the romantic comedy with identifier movie_id. This should be a symmetric table so that if pid1, pid2, m is in the result, then so should be pid2, pid1, m. However, it should not include records where pid1 and pid2 are equal. Select R1.person_id as pid1, R2.person_id as pid2, M.movie_id as movie_id from >>
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started