Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial Databases 2nd Symposium Ssd 91 Zurich Switzerland August 1991 Proceedings Lncs 525

Authors: Oliver Gunther ,Hans-Jorg Schek

1st Edition

3540544143, 978-3540544142

More Books

Students also viewed these Databases questions