Martin Mollov Sitch Write an SQL query to search the imdb database for all directors who...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 (IÍI) 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. 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 (IÍI) 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.
Expert Answer:
Answer rating: 100% (QA)
select afirstname as firstname alastname as lastname from select actorid as actorid director... View the full answer
Related Book For
Modern Database Management
ISBN: 978-0133544619
12th edition
Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi
Posted Date:
Students also viewed these databases questions
-
Write an SQL query to answer the following question: 1. Which instructors are qualified to teach ISM 3113? 2. Write an SQL query to answer the following question: Is any instructor qualified to teach...
-
Write an SQL query to list each customer who bought at least one product that belongs to product line Basic in March 2015. List each customer only once.
-
Write an SQL query to list the salesperson who has sold the most computer desks.
-
Solve: y(4) +18y"+81y = 0 y(0) = -4, y'(0) = 8, y'(0) = 42, y"(0) = -108 - Submit Question X
-
The Pearce Club, Inc., is considering investing in an exercise machine that costs $5,000 and would increase revenues by $1,500 a year for five years. The machine would be depreciated using the...
-
Review the case description and your solution for the Web scenario of the use case Request package pickup from Chapter 5. Then, using a presentation tool, such as Microsoft PowerPoint or Apple...
-
The notes to financial statements present information on significant accounting policies, complex or special transactions, details of reported amounts, commitments, contingencies, segments, quarterly...
-
This is a comprehensive project evaluation problem bringing together much of what you have learned in this and previous chapters. Suppose you have been hired as a financial consultant to Defense...
-
28: Select the correct statement. Question 29 options: (A) Imputed income is subject to tax (B) Realized income is subject to tax if recognized (C) Excluded income is subject to tax (D) A and B but...
-
6. Write an SQL script that does the following and save this script as CIS276DA_FinalExercise6_MEID.sql . Save the output of this script as CIS276DA_FinalExercise6_MEID.csv Your results should...
-
Blue Spruce Corp. sells a snowboard, EZslide, that is popular with snowboard enthusiasts. Below is information relating to Blue Spruce Corp. s purchases of EZslide snowboards during September. During...
-
Find a news lead and a feature lead that you thought were particularly effective, and a pair of each that were not as good. Post the leads (four total) and write-a few sentences about what separates...
-
11. Consider the three stocks in the following table. P, repre- sents price at time t, and Q, represents shares outstanding at time t. Stock C splits two for one in the last period. Po Q0 P Q1 P Q2 A...
-
Watch the Cultural Awareness Speech on Filipino Hand-Held Fan https://www.youtube.com/watch?v=VbA7TdJ4OWc How could the speaker have better organized the main points of her speech? Where would you...
-
Kellogg pays $3.50 in annual per share dividends to its common stockholders, and its recent stock price was $93.80. Assume that Kellogg's cost of equity capital is 5.0%. Estimate Kellogg's expected...
-
In what ways was Peter an absolutist ruler? What did he hope to accomplish? Was he successful as a ruler? In what ways does he compare with another famous absolutist king -- King Louis XIV of France?
-
Question 12. Consider the information below about the following three stocks: Amethyst, Sapphire and Tanzanite. Amethyst Market Price $26 Sapphire $16 Tanzanite $10 Number of Shares 4 20 3 Cash $10...
-
Government is advised to tax goods whose demand curves are inelastic if the goal is to raise tax revenues. If the goal is to discourage consumption, then it ought to tax goods whose demand curves are...
-
Consider the following normalized relations from a database in a large retail chain: What opportunities might exist for denormalizing these relations when defining the physical records for this...
-
What are the benefits of enforcing the integrity constraints as part of the database design and implementation process (instead of doing it in application design)?
-
Give an example, other than those described in this chapter, of a weak entity type. Why is it necessary to indicate an identifying relationship?
-
For each of the following statements, either prove it is true or give a counterexample to show it is false. (a) The product of two rational numbers is always rational. (b) The product of two...
-
Which of the following numbers are rational and which are irrational? (a) \(\sqrt{2}+\sqrt{\frac{3}{2}}\). (b) \(1+\sqrt{2}+\sqrt{\frac{3}{2}}\). (c) \(2 \sqrt{18}-3 \sqrt{8}+\sqrt{4}\). (d)...
-
(a) Let \(a, b\) be rationals and \(x\) irrational. Show that if \(\frac{x+a}{x+b}\) is rational, then \(a=b\). (b) Let \(x, y\) be rationals such that \(\frac{x^{2}+x+\sqrt{2}}{y^{2}+y+\sqrt{2}}\)...
Study smarter with the SolutionInn App