SQL Server·SQL Server essentials

Joins

Join tables on keys and check cardinality.

Intermediate 10 min read Lesson 2 of 150 Challenge included
What you will be able to do
  • Use INNER and LEFT JOIN.
  • Alias tables.
  • Use EXISTS for semi-joins.

In plain English

Join tables on keys and check cardinality.

  • Use INNER and LEFT JOIN.
  • Alias tables.
  • Use EXISTS for semi-joins.
joins.sqlSQL
SELECT c.title, COUNT(l.id) AS lessons
FROM courses c
LEFT JOIN lessons l ON l.course_id = c.id
GROUP BY c.id, c.title;
Your turn

Explain it back

Easy

Answer from memory: Which join keeps unmatched left rows?

TEXT · starter
Your answer…
Check your understanding before moving on.
Knowledge checkQuestion 1

Which join keeps unmatched left rows?

Select an answer to continue
Study tools

Make it yours.

Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.

Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Next: Indexes
Lesson 2 of 150 · 0% of course