Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

database Description In this Assignemen you ase asked to write 12SQL queries on a relational movie database. The data in this database is fion the

database
image text in transcribed
Description In this Assignemen you ase asked to write 12SQL queries on a relational movie database. The data in this database is fion the IMDB website. The database consists of seven tables; however you will be using only the following five tables - aCTOR fid fname, lame, gendar - MOVZE fid, name, year, nanb) - DIRECTOR (dd fiame, Imane) - CAST (pid, mid, nodel - MOFIE DIRECTOR (did. mide id column in ACTOR, MOVIE \& DIRECTOR tables is a key for the respective table. CAST pid refers to ACTOR. id, CAST mid refers to MOVIE id MOVIE_DIRECTOR did refers to DIRECTOR id and MOVIE_DIRECTOR mid refers to MOVIE.id n T7/7 Mroma Univerily 1. a. List all the actors who acted in af least one film in 2nd half of the 19 the century and in at least one film in the Ist half of the 20th century b. List all the directors who directed a film in a loap year 2. List all the movies that have the same year as the movie 'Shrek (2001), but a better rank. (Note; bigger valoe of rank implies a better rank) 3. List first name and last nanse of all the actions who played in the movie Oofficer 444(1926) 4. List all directors in descending order of the number of films they dirscied 5. a. Find the films(s) with the largest cast. b. Find the film(s) with the smallest cast. In both cases, also return the siee of the cash. 6. Find all the actors who acted in films by at lease 10 divtinct directors (Ce. actors who worked with at least to dissinct directors). 7. Find all aktors who acted only in films before 1960 . 8. Find the films with moee women actors than men. 9. For every puir of male and fenale actors that appear sogether in suese film, find the total number of films in which they appear sogether. Sort the answers in decreasing oeder of the toul namber of films. 10. For every actoc, Eist the films beishe appeared in their debut year, Sort the results by last name of the astor. 11. The Biacon namber of an actor is the length of the shortest path between the actor and Kevin Bacon in the "co-acting" graph, That is, Kevin Bacon has Bacon number 0 ; all actors who acted in the same film as KB have Bacon number 1; all actors who acted in the same film as some actor with Bacoe number 1 have Bacon number 2, etc. Return all actors whose Bacon number is 2. 12. Bonus: Suppose you write a single SFL.FCT-FROM-WHERE 5QL query that returns all actors whose Bacon number is infinity. How big is the query? Note: The above "Botus" froblem is ill-stated. The curred one sbould be as follows: Suppose yow write a single SEL FCT-FROM-WHERE SQL quary that retams all

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

Case Studies In Business Data Bases

Authors: James Bradley

1st Edition

0030141346, 978-0030141348

More Books

Students also viewed these Databases questions