Add lesson: advanced joins#18
Merged
Merged
Conversation
Covers RIGHT JOIN (and why LEFT is usually preferred), FULL OUTER JOIN for reconciliation, CROSS JOIN for Cartesian products, the self-join pattern for in-table hierarchies (employees/manager_id), and multi-table chains. Closes with a "when to use which" decision table. Also updates 01-joins's "Up next" pointer to lead into this lesson. Part of #6. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
exekias
commented
May 28, 2026
Comment on lines
+102
to
+112
| A useful mental table: | ||
|
|
||
| | You want… | Use | | ||
| | ------------------------------------------------------------ | -------------- | | ||
| | Rows that match on both sides | `INNER JOIN` | | ||
| | All rows from the left, matches from the right where present | `LEFT JOIN` | | ||
| | Same, but with the tables in the other order | `RIGHT JOIN` | | ||
| | All rows from both sides, NULLs where they don't match | `FULL JOIN` | | ||
| | Every combination of left × right | `CROSS JOIN` | | ||
| | A row's relationship to other rows in the same table | self-join | | ||
|
|
Member
Author
There was a problem hiding this comment.
@copilot this table didn't render correctly, fix it
Contributor
There was a problem hiding this comment.
Fixed in the latest commit. remark-gfm isn't installed, so GFM pipe tables don't render in MDX. Replaced the markdown table with a plain HTML <table> — MDX handles it natively and @tailwindcss/typography's prose class takes care of styling.
Member
Author
There was a problem hiding this comment.
@copilot I would rather go for remark-gfm approach if that's not too complex
Contributor
There was a problem hiding this comment.
Done — installed remark-gfm and added it to MDXRemote's remarkPlugins in page.tsx. The GFM pipe table in the lesson is restored as-is.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
10-advanced-joins(module-relative02-advanced-joins).RIGHT JOIN(and whyLEFTis usually preferred),FULL OUTER JOINfor reconciliation,CROSS JOINfor Cartesian products, the self-join pattern using amanager_idself-reference, and multi-table chains. Closes with a "when to use which" decision table.01-joins's "Up next" pointer to lead into this lesson.Part of #6.
Test plan
npm run lessons:validatenpx tsc --noEmitnpm run lint/lessons/10-advanced-joins/preview— confirm the FULL JOIN surfaces both Operations (no employees) and the two contractors (no department), and that the self-join lists each employee alongside their manager🤖 Generated with Claude Code