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

Instruction

Good! Let's try the first exercise with the Person table.

Exercise

Show the name of each person (name the column ChildName) together with the name of their mother (name the column MotherName). Include all people even those for whom there is no information about their mother.

Stuck? Here's a hint!

Type:

SELECT
  Child.Name  AS ChildName,
  Mother.Name AS MotherName
FROM Person AS Child
LEFT JOIN Person AS Mother
  ON Child.MotherId = Mother.Id