<<< Challengers >>>
Scenario Movies
b2b9231b6443a0aa5631c90be81fc38491833122132db85f5699b268df22e189
See details on the model
In this scenario, we have three tables representing movies and the actors appearing in movies.
The table person contains the list of people who are actors or directors in movies; this table has 2 attributes:
- id a unique identifier for this person
- name the name of that person
The table movie that has 6 attributes:
- id a unique identifier for the movie
- title the name of the movie
- yr the year the movie was released
- director an integer (referring to the id of someone in the person table)
- budget the budget of the movie (in dollars)
- gross the amount of money generated by the movie (in dollars)
The table casting describes which actor playing in which movie and has 3 attributes:
- actorid, an integer referring to a person (who played in the movie)
- movieid, an integer referring to a movie (in which movie the actor played in)
- ord, an integer that describes the importance of the character the actor plays in the movie (1 means main character, 2 is the second role, etc.).
Question
We say that two actors X and Y are challengers if X was the leading actor in a movie where Y appeared and Y was the leading actor in a movie where X appeared. Compute all pairs X, Y of challengers where the name of X comes before Y in alphabetical order.
{"rows":[["Donnie Wahlberg","Tobin Bell"],["Johnny Depp","Orlando Bloom"],["Rene Russo","Robert De Niro"],["Jim Cummings","John Fiedler"],["Freddie Prinze, Jr.","Sarah Michelle Gellar"],["Hugh Jackman","Patrick Stewart"],["Marlon Wayans","Shawn Wayans"],["Andy Samberg","Bill Hader"],["Jason Statham","Vinnie Jones"],["Ben Affleck","Jason Bateman"],["Luke Wilson","Will Ferrell"],["Alfre Woodard","Sanaa Lathan"],["Ben Stiller","Vince Vaughn"],["James Caviezel","Jim Caviezel"],["Adam Sandler","John Turturro"],["John Corbett","Nia Vardalos"],["Ben Stiller","Owen Wilson"],["Jay Baruchel","Seth Rogen"],["Antonio Banderas","Salma Hayek"],["Dwayne Johnson","The Rock"],["Cuba Gooding Jr.","Cuba Gooding, Jr."],["Billy Bob Thornton","Bruce Willis"],["Bill Murray","Owen Wilson"],["Billy Connolly","Emily Browning"],["Adam Sandler","Rob Schneider"],["Clive Owen","Julia Roberts"],["Jason Segel","Paul Rudd"],["Kate Hudson","Matthew McConaughey"],["Anne Katarine","Steve Martin"],["David Koechner","Dax Shepard"],["Bill Nighy","Kate Beckinsale"],["Kieran Culkin","Rory Culkin"],["Cedric the Entertainer","Steve Harvey"],["Ben Stiller","Will Ferrell"],["Tim Meadows","Will Ferrell"],["Jonah Hill","Seth Rogen"]],"fields":[{"name":"name","dataTypeID":1043},{"name":"name","dataTypeID":1043}],"affectedRows":0}
False
False