Simulate RIGHT JOIN: All Products Including Unsold
Medium
joins
Amazon
Shopify
Meta
Note: SQLite does not support RIGHT JOIN. Simulate it by using a LEFT JOIN with the tables in the correct order.
Return all products alongside total units sold. Products with no sales should show 0 for total_sold.
Equivalent to: sales RIGHT JOIN products
Simulate as: products LEFT JOIN sales
Expected Output
| product_name | total_sold |
|---|---|
| Widget | 7 |
| Gadget | 3 |
| Doohickey | 0 |
| Gizmo | 5 |
Tables
Hints (3 available)
SQL Editor
Output
Click "Run" to see results...