From the course: Introduction to SQL Using Google BigQuery

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

INNER JOIN

INNER JOIN

- [Instructor] Let's dive right into the inner join. This is probably the most popular join in the BigQuery SQL toolbox, so it will definitely pay dividends for us to really understand the mechanics behind the inner join. The inner join only returns rows which meet the join condition, meaning that all records which don't evaluate to true on the joining condition will be removed. The inner join can be thought of as effectively a cross join, a Cartesian product between all of the elements from both left and right sides of the join, and then applying a filter which keeps all the matching records only based on the join condition. Luckily, the inner join is a bit more efficient than a cross join, as the joining condition doesn't require all of the rows from both sides of the join to be physically materialized during the execution phase. If we break down the inner join into the left and right sides of the table, imagine that we…

Contents