I'm trying to design a and entirely query/ procedure driven "Kevin Bacon number finder" in SQL Server and am not even sure about where to start. If anyone can give some help, or point me to something similar, I would be appreciative as I have searched and am unable to find something similar to what I need that doesn't rely on using OO programming.
The "Kevin Bacon number" refers to the "Six Degrees Of Kevin Bacon" where actors can be linked through his or her film roles to actor Kevin Bacon within six steps. However I need to find the number of steps in the process even if exceeding 6 steps.
The schema that I have to use is:
ACTOR (id, fname, lname, gender)
MOVIE (id, name, year, rank)
DIRECTORS (id, fname, lname)
CASTS (pid, mid, role)
MOVIE_DIRECTORS (did, mid)
GENRE (genre, mid)
With CASTS.pid refers to ACTOR.id, CASTS.mid refers to MOVIE.id.