JOIN combines matching rows from related tables.
JOIN combines matching rows from related tables. Read the query line by line and identify the input table, the transformation, and the shape of the result before running it.
SELECT o.order_id, c.name, o.amount FROM orders o JOIN customers c ON c.customer_id = o.customer_id ORDER BY o.order_id;
Before running the example, predict the output columns and whether the query returns one row, many rows, or possibly no rows.
In your own words, explain the main SQL feature in today’s lesson and why it answers the question.
Recall prompt: Join orders to customers on customer_id. Close this page section mentally and explain the query from memory before proceeding.
Show every order with the customer's name and order amount.
Join orders to customers on customer_id.