Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

JOIN πŸ“

Learning Goals

By the end of this section you will:

  • understand that joins are used to extract data from multiple tables

  • know how to combine tables using inner joins and extract data from it

Joins are used in SQL to combine rows from two or more tables based on a related column between them. Instead of writing multiple subqueries, joins let you pull data from different tables into a single result. This is helpful when related information is stored across separate tables, such as customers and their orders. By using joins, you can view and analyse all the connected data in one query result.

Go to the W3schools Tutorial on Joins and complete their exercises (we will only be worried about inner joins)

The JOIN ClauseΒΆ

The SQLite JOIN clause is used to combine rows from two or more tables based on a related column they share. Go to the W3schools Tutorial on the INNER JOIN Keyword and complete their exercises. Note, in SQLite we can just use JOIN in place of INNER JOIN.