|
![](/i/fill.gif) |
Completely unrelated to what you wrote, but it reminded me of something
I wondered some time ago:
Assume you have a table with movie names and another with actor names,
and a relationship between the two telling which actors have acted in which
movies.
Problem: Can you write an SQL statement which solves the "six degrees of
Kevin Bacon" relationship between any two given actors?
In other words, you give it two actor names and it tells you how many
steps apart they are from each other, via common movies they have acted in.
(Ie. if they have acted in the same movie, their degree of separation is 1,
if they haven't acted in the same movie but have acted with the same third
person, their degree of separation is 2, and so on.)
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |