Skip to content

Instantly share code, notes, and snippets.

@mdang
Last active January 25, 2017 16:09
Show Gist options
  • Save mdang/cba62c6fbcf7101fb4ac3c64d1be55de to your computer and use it in GitHub Desktop.
Save mdang/cba62c6fbcf7101fb4ac3c64d1be55de to your computer and use it in GitHub Desktop.
Lesson: Relational Data with Joins

Relational Data With Joins

Learning Objectives

Agenda

  • Review SQL commands for CRUD
  • Introduce:
    • count
    • order by
    • limit

--

Exercise:

15 min

https://gist.github.com/mdang/7e68c9473de0c0363d9b778d7ca02c2b

--

Joins

An SQL JOIN clause is used to combine rows from two or more tables, based on a common field between them. There are different types of joins available in SQL:

  • INNER JOIN: returns rows when there is a match in both tables
  • LEFT JOIN: returns all rows from the left table, even if there are no matches in the right table

https://blog.codinghorror.com/a-visual-explanation-of-sql-joins/

Exercise

20 min

https://gist.github.com/mdang/9a4a8063ebea3b829b8025746643ade1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment