Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Schema: (name, id, n), where name is the name of the actor, id is the actor id, and n either 1, 2 or 3 depending

image text in transcribedimage text in transcribedimage text in transcribed

Schema: (name, id, n), where name is the name of the actor, id is the actor id, and n either 1, 2 or 3 depending on whether there is a 1-connection, 2-connection, or 3-connection to Brian Evers' Race Jellybean Oreo 1 Pipo 0 A Day in Hawaii The Forest) Toto Leon Yu Light Rider movie-cast movie Puff 0 Crew-in Omitted crew.in Appendix A: The IMDb Database Attribute Attribute Type Type varchar(255) genre name movie id cast idt cast_in number(7) number(7) varchar(255) Attribute Type charac movie id number (7) varchar(255) Type title Attribute movie id movie number (7) number(7) crew_in crew id runtime release_year rating num_ratings number(7) number (7) varchar(255) job float(2) number (7) Attribute Type Attribute Type movie id movie_ genre number(7) varchar(255) id genre names crew gender number(7) number(7) varchar(255) name Attribute movie_k kwd name eyword movie id Type varchar(255) number(7) Attribute Type id movie_ cast? gender name number(7) number(7) varchar(255) * Filled colors in the 'Attribute' columns indicate references between relations * Keys are underlined Question 8. (10 points, M2) ** Consider the 'actors network captured via relations within the IMDb database. We define the notion of an n-connection between actors based on the movies in which they have acted; this is very similar to an Erdos number based on co-authorship. Every actor has a 0-connection with themself. Two actors have a 1-connection with each other if they both acted in the same movie. Two actors have a 2-connection with each other if they have never acted in the same movie (so do not have a 1-connection) but each have a 1-connection with the same actor (via different movies). Two actors, A and B, have a 3-connection with each other if they do not have a 1- or 2-connection with each other, but each has a 1- or 2-connection with the same actor (via different movies). And so on. For example, the network below illustrates n-connections relative to the actor Leon. In this diagram, the grey nodes are actors (e.g. Leon), the blue nodes are movies (e.g. "Race"), and an edge between an actor and a movie indicates that the actor was cast in the movie. The number in a grey node is the n of the n-connection to Leon. So: - Leon has a 0-connection with himself - Puff has a 1-connection to Leon since the both acted in "Light Rider Oreo and Pipo both have a 1-connection to Leon since all acted in "A Day in Hawaii" Jellybean has a 2-connection to Leon: Jellybean and Pipo have a 1-connection since they both acted in "Race", and Pipo and Leon have a 1-connection since they both acted in A Day in Hawaii. However, Jellybean and Leon have never acted in the same movie. Toto has a 3-connection to Leon: Toto has a 1-connection to Jellybean, and Jellybean has a 2-connection to Leon. However, Toto and Leon have never acted in the same movie. Another way of thinking about this is that the 'n-connection between two actors A and B is the number of movie nodes on the shortest path between A and B. For example, the shortest path from Leon to Pipo involves one movie node (A Day in Hawaii), the shortest path from Leon to Jellybean involves 2 movie nodes ("A Day in Hawaii and Race"), and the shortest path from Leon to Yu involves 3 movie nodes ("A Day in Hawaii, Race", and "The Forest"). Print the actor id and names of all actors that are 1-, 2- and 3-connections for the actor Brian Evers'. Hint: Think about the nodes (movie_cast, movie) and edges (cast_in) in the graph as the joins you need to do in the query

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

Modern Database Management

Authors: Heikki Topi, Jeffrey A Hoffer, Ramesh Venkataraman

13th Edition

0134773659, 978-0134773650

More Books

Students also viewed these Databases questions

Question

Provide examples of KPIs in Human Capital Management.

Answered: 1 week ago

Question

What are OLAP Cubes?

Answered: 1 week ago