I'm working on Pset 7 "Movies" and
check50 shows an error for 13.sql (list of Kevin Bacon's co-stars) when I submit my code despite running successfully in the IDE.
The exact error message is
Error when executing query: too many statements at once and my code is below.
I thought that the issue might be runtime, so I tried indexing two of the joined columns so the query would run faster. When run my code with the
INDEX addition in the IDE, I get the same successful output of Kevin Bacon's co-stars but still fail
check50 upon submission.
Is there a maximum number of subqueries that
check50 can handle? If so, does anyone have suggestions on how to streamline my code?
///Tried including above body of code but still resulted in error/// CREATE INDEX people_index ON people(id); CREATE INDEX movie_index ON stars(movie_id);
SELECT DISTINCT people.name FROM people JOIN stars ON stars.person_id = people.id WHERE stars.movie_id in ( SELECT movies.id FROM movies JOIN stars ON movies.id = stars.movie_id WHERE stars.person_id in ( SELECT people.id FROM people WHERE people.name = "Kevin Bacon" AND people.birth == 1958 ) ) AND people.name != "Kevin Bacon";