Question: --- Actors | actorid | firstname | lastname | yearofbirth | | ------- | --------- | --------- | ----------- | | 1 | Carrie |
---
Actors
| actorid | firstname | lastname | yearofbirth |
| ------- | --------- | --------- | ----------- |
| 1 | Carrie | Fisher | 1956 |
| 2 | Mark | Hamill | 1951 |
| 3 | Harrison | Ford | 1944 |
| 4 | Billy Dee | Williams | 1937 |
| 5 | Danny | Trejo | 1937 |
| 6 | Michelle | Rodriguez | 1978 |
| 7 | Jessica | Alba | |
| 8 | John | Doe | |
---
Movies
| movieid | title | year | director |
| ------- | ------------------------------------ | ---- | ---------------- |
| 1 | Star Wars | 1977 | George Lucas |
| 2 | Raiders of the Lost Ark | 1981 | Steven Spielberg |
| 3 | Indiana Jones and the Temple of Doom | 1984 | Steven Spielberg |
| 4 | Machete | 2010 | Robert Rodriguez |
---
Movie_cast
| actorid | movieid |
| ------- | ------- |
| 1 | 1 |
| 2 | 1 |
| 3 | 1 |
| 4 | 1 |
| 3 | 2 |
| 3 | 3 |
| 5 | 4 |
| 6 | 4 |
| 7 | 4 |
---
Write a SQL select statement to find all actors who never worked with director Robert Rodriguez. Your query should return a relation with the same schema as the one shown below. Records should be sorted by actors last name.
| firstname | lastname |
|-----------|----------|
| John | Doe |
| Carrie | Fisher |
| Harrison | Ford |
| Mark | Hamill |
| Billy Dee | Williams |
Make sure that your answer adopts the same output-schema and sorting order as above. Your SQL statement must work properly on any arbitrary database instance (i.e. it should not be restricted to the database instance given here).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
