Problem 2b goes as follows:
2b. For each subject show the first year that the prize was awarded.
nobel(yr, subject, winner)
My solution was this:
SELECT DISTINCT subject, yr
FROM nobel
ORDER BY yr ASC;
Why isn’t this working?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your answer gets a row for every distinct combination of subject and year.
The correct answer GROUPS BY the subject, and gets the MIN year per subject.
Enough of a clue?