Clarification on JOIN statements SQL
11:24 01 Jul 2026

So, I am taking the Google Data Analytics class and I'm learning about using SQL and BigQuery. Some of these examples got me questioning how they work though. Take this for instance, so I know the FROM statement sets the warehouse orders dataset as an alias 'orders'. But the JOIN statement? It seems to call on the warehouse dataset and join it with the orders dataset based off the fact both datasets have a warehouse ID in them. I understand what it does, just not the why. What does the ON function do here? Why the warehouse after the dataset id? Is it another alias? I am just a little confused as to why it works.

FROM
    `your-project-name.warehouse_orders.orders` AS orders
JOIN
  `your-project-name.warehouse_orders.warehouse` warehouse ON orders.warehouse_id = warehouse.warehouse_id
sql join google-bigquery