0
0
SQLquery~10 mins

LEFT JOIN vs RIGHT JOIN decision in SQL - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to select all customers and their orders, even if they have no orders.

SQL
SELECT customers.name, orders.order_id FROM customers [1] orders ON customers.id = orders.customer_id;
Drag options to blanks, or click blank then click option'
AINNER JOIN
BLEFT JOIN
CRIGHT JOIN
DFULL JOIN
Attempts:
3 left
💡 Hint
Common Mistakes
Using INNER JOIN will exclude customers without orders.
Using RIGHT JOIN will keep all orders, not all customers.
2fill in blank
medium

Complete the code to select all orders and their customers, even if some orders have no customer info.

SQL
SELECT orders.order_id, customers.name FROM orders [1] customers ON orders.customer_id = customers.id;
Drag options to blanks, or click blank then click option'
ARIGHT JOIN
BINNER JOIN
CLEFT JOIN
DFULL JOIN
Attempts:
3 left
💡 Hint
Common Mistakes
Using INNER JOIN excludes orders without customers.
Using RIGHT JOIN keeps all customers, not all orders.
3fill in blank
hard

Fix the error in the join to get all employees and their departments, even if some employees have no department.

SQL
SELECT employees.name, departments.name FROM employees [1] departments ON employees.dept_id = departments.id;
Drag options to blanks, or click blank then click option'
ARIGHT JOIN
BINNER JOIN
CCROSS JOIN
DLEFT JOIN
Attempts:
3 left
💡 Hint
Common Mistakes
Using INNER JOIN excludes employees without departments.
RIGHT JOIN keeps all departments, not employees.
4fill in blank
hard

Fill both blanks to select all products and their suppliers, even if some products have no supplier info.

SQL
SELECT products.name, suppliers.name FROM products [1] suppliers ON products.supplier_id [2] suppliers.id;
Drag options to blanks, or click blank then click option'
ALEFT JOIN
B=
C!=
DRIGHT JOIN
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' in ON condition causes wrong matches.
RIGHT JOIN keeps all suppliers, not products.
5fill in blank
hard

Fill all three blanks to select all orders and their shipping info, even if some orders have no shipping data.

SQL
SELECT orders.id, shipping.status, shipping.date FROM orders [1] shipping ON orders.ship_id [2] shipping.id AND shipping.status [3] 'delivered';
Drag options to blanks, or click blank then click option'
ALEFT JOIN
B=
C!=
DRIGHT JOIN
Attempts:
3 left
💡 Hint
Common Mistakes
Using RIGHT JOIN keeps all shipping info, not orders.
Using WHERE for the status filter (instead of ON) would exclude orders without shipping.