89
•
Find all authors who have a vocabulary over
10000 words:
SELECT
Author.name
FROM
Author, Wrote, Mentions
WHERE
Author.login=Wrote.login AND Wrote.url=Mentions.url
GROUP BY
Author.name
HAVING
count(distinct Mentions.word) > 10000
Look carefully at the last two queries: you may
be tempted to write them as a nested queries,
but in SQL we write them best with GROUP BY