Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Martin Mollov Sitch Write an SQL query to search the imdb database for all directors who have appeared in one of their own movies,

 

Martin Mollov Sitch Write an SQL query to search the imdb database for all directors who have appeared in one of their own movies, playing two or more characters in th same movie. Show only the names of the director, in alphabetical order by last name ascending, breaking ties by first name in ascending order. Each director should be listed only once. Recall the imdb database tables: actors movies roles id first name last name gender id name year rank actor_id movie_id role 433259| William Shatner M 112290 Fight Club 1999 8.5 433259 313398 Capt. James T. Kirk 797926 Britney Spears F 209658 Meet the Parents 2000 7 433259 407323 Sgt. T.J. Hooker 831289 Sigourney Weaver F 210511 Memento 2000 8.7 797926 342189 Herself directors movies directors movies genres id first name last name director id movie id movie id genre 24758 David Fincher 24758 112290 209658 Comedy 66965 Jay Roach 66965 209658 313398 Action 72723 William Shatner 72723 313398 313398 Sci-Fi **. When run on the imdb database, your query would produce the following results: first name last name LeVar Santo Claus Theo Tom Jane Tony (II) Bili Mick (I) Burton Cilauro Gartner Gleisner Kennedy (I) Melendez Renier Yves Rob Jason James Stephens Tolkan 12 rows in set Note that actor IDs and director IDs are not equal, but you may assume that only one actor and director share the same first/last name. If you join too many tables together that are not needed for the query, you will not receive full credit. You should solve this problem using only the SQL syntax taught in class.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

select afirstname as firstname alastname as lastname from select actorid as actorid director... 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_2

Step: 3

blur-text-image_3

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions