Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 9.sql #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

gauravpdaksh
Copy link

@gauravpdaksh gauravpdaksh commented Jan 25, 2022

Bro, your code is somewhat wrong. :)
It is giving 18188 rows. But, the CS50 website says the answer contains 18237 rows (excluding header).
(According to the cs50 2021 version)

So I wrote the new code:
SELECT name FROM people
JOIN stars ON people.id = stars.person_id
JOIN movies ON stars.movie_id = movies.id
WHERE movies.year = 2004
GROUP BY people.id
ORDER BY birth;

Bro, your code is wrong. :)
It is giving 18188 rows. But, the CS50 website says the answer contains 18237 rows (excluding header).
(According to the cs50 2021 version)

So I wrote the new code:
SELECT name FROM people
JOIN stars ON people.id = stars.person_id
JOIN movies ON stars.movie_id = movies.id
WHERE movies.year = 2004
GROUP BY people.id
ORDER BY birth;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant