0
0
SQLquery~10 mins

Joining more than two tables in SQL - Interactive Code Practice

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

Complete the code to join two tables on the customer_id column.

SQL
SELECT orders.order_id, customers.name FROM orders JOIN [1] ON orders.customer_id = customers.customer_id;
Drag options to blanks, or click blank then click option'
Asuppliers
Bproducts
Cemployees
Dcustomers
Attempts:
3 left
💡 Hint
Common Mistakes
Joining with the wrong table like products or employees.
Forgetting to specify the join condition.
2fill in blank
medium

Complete the code to join three tables: orders, customers, and products.

SQL
SELECT orders.order_id, customers.name, products.product_name FROM orders JOIN customers ON orders.customer_id = customers.customer_id JOIN [1] ON orders.product_id = products.product_id;
Drag options to blanks, or click blank then click option'
Acategories
Bproducts
Csuppliers
Demployees
Attempts:
3 left
💡 Hint
Common Mistakes
Joining with employees or suppliers instead of products.
Using wrong join conditions.
3fill in blank
hard

Fix the error in the join condition to correctly join orders and customers.

SQL
SELECT orders.order_id, customers.name FROM orders JOIN customers ON orders.[1] = customers.customer_id;
Drag options to blanks, or click blank then click option'
Acustomer_id
Border_id
Cproduct_id
Demployee_id
Attempts:
3 left
💡 Hint
Common Mistakes
Using order_id instead of customer_id in the join condition.
Joining on unrelated columns like product_id or employee_id.
4fill in blank
hard

Fill both blanks to join orders, customers, and products correctly.

SQL
SELECT orders.order_id, customers.name, products.product_name FROM orders JOIN [1] ON orders.customer_id = customers.customer_id JOIN [2] ON orders.product_id = products.product_id;
Drag options to blanks, or click blank then click option'
Acustomers
Bemployees
Cproducts
Dsuppliers
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of tables in joins.
Joining with unrelated tables like employees or suppliers.
5fill in blank
hard

Fill all three blanks to join orders, customers, and products and filter orders with quantity greater than 5.

SQL
SELECT orders.order_id, customers.name, products.product_name FROM orders JOIN [1] ON orders.customer_id = customers.customer_id JOIN [2] ON orders.product_id = products.product_id WHERE orders.[3] > 5;
Drag options to blanks, or click blank then click option'
Acustomers
Bquantity
Cproducts
Demployee_id
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong table names in joins.
Filtering on a column that does not exist or is unrelated.