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:
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;Ctrl+Enter to submit
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.