Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Dictionary database
7. Dictionary table – exercise 2
Summary

Instruction

Good! You don't have to limit joining a table with itself to just a single join.

Exercise

Show each dictionary entry (name the column Entry) together with the name of its direct hypernym (name the column Hypernym) and the name of that hypernym's hypernym (name the column Grandhypernym).

Only include words that have both a direct hypernym and a "grandhypernym".

Stuck? Here's a hint!

Type:

SELECT
  Entry.Word AS Entry,
  Hypernym.Word AS Hypernym,
  SuperHypernym.Word AS Grandhypernym
FROM Dictionary AS Entry
JOIN Dictionary AS Hypernym
  ON Entry.HypernymId = Hypernym.EntryId
JOIN Dictionary AS SuperHypernym
  ON Hypernym.HypernymId = SuperHypernym.EntryId