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?
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?
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?