LXLogicExcel
๐Ÿ”ฅ
0
โญ
0
JOIN - Combining Tables1 / 10
In SQL, you can use a JOIN to combine different tables. You join them by a common column, like the customer_id in both tables below.

We can match the customer_id in the orders with the customer_id in the customers table to combine the tables and get a result that you couldn't get from either table alone. Try:

SELECT customer_name, order_total FROM customers INNER JOIN orders ON customers.customer_id = orders.customer_id;
customer_idcustomer_namecountry
1AliceUSA
2BobCanada
3CarlosSpain
4DianaUK
order_idcustomer_idorder_total
101145.99
102189.50
103222.00
1045100.00

Ctrl+Enter to submit

๐Ÿ”ฅ 0 streak
โญ 0 XP this lesson
All Lessons

JOIN - Combining Tables - Free SQL Practice Online

Practise JOIN - Combining Tables with 10 free, interactive SQL exercises. You type real queries into your browser and get instant feedback on every answer - no database setup, no install, and no signup. It is a fast, hands-on way to learn SQL online and build query skills you can use at work.