Question: Write a sql query for the following The Bacon number of an actor is the length of the shortest path between the actor and Kevin

Write a sql query for the following

The Bacon number 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 (KB) 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 Bacon number 1 have Bacon number 2, etc.

  • Return all actors whose Bacon number is K (user-input integer). (25 points)

  • Compute the Bacon Degree for the actor 'XYZ' (user-input actor name). (25 points)

tables are:

crews:

movie_id
credit_id
crew_id
crew_name
gender_id
job

casts:

movie_id
cast_id
cast_name
character_name
gender_id
credit_id

genres

movie_id
genre_id
genre_name

movies:

movie_id
release_date
title
vote_average
vote_count

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!