SQL JOINs
Combine related data from two tables using matching keys.
How it works
JOINs let you connect normalized tables without copying data into one giant dataset. The ON condition defines how rows relate.
INNER JOIN keeps only matches. LEFT JOIN keeps every row from the left table and adds matching right-side data when available, which is useful for finding missing master data.
Join a production-order table to material master data, or transaction records to employee/operator names.
The pattern
SELECT a.column, b.column
FROM TableA a
INNER JOIN TableB b ON a.Key = b.Key;Example
SELECT Orders.OrderID, Customers.CustomerName
FROM Orders
INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID;Run the example
Edit the query and run it against the built-in demo tables. Nothing is sent to a server.
The learning runner supports SELECT, WHERE, LIKE, IN, BETWEEN, GROUP BY, HAVING, JOIN, aggregates, ORDER BY and LIMIT. Advanced lessons explain additional production SQL concepts even when the mini runner does not execute that syntax.
Which join keeps every row from the left table?
Progress is stored only in this browser. No account required.