SQL Practice Exercise for joins
Chapter 6: Practice Exercise for joins
Create 2 tables for a chai store
We will create 2 tables for a chai store so that we can practice joins. The tables will be:
- chai
- orders
chai table
Let’s add some sample data to the chai table:
orders table
Let’s add some sample data to the orders table:
Join challenges
Inner Join
Get the list of all orders with the chai variety and customer details.
Left Join
Show all customers and their orders, but also include customers who haven’t ordered anything yet (if any).
Right Join
Show all chai varieties, including those that haven’t been ordered yet.
FULL OUTER JOIN
List all customers and all chai varieties, with or without orders.