0
0
SQLquery~10 mins

INNER JOIN with multiple conditions 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 a single condition.

SQL
SELECT * FROM orders INNER JOIN customers ON orders.customer_id [1] customers.id;
Drag options to blanks, or click blank then click option'
A=
B!=
C<
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' instead of '=' causes no matching rows.
Using '<' or '>' is incorrect for join conditions.
2fill in blank
medium

Complete the code to join on two conditions using AND.

SQL
SELECT * FROM orders INNER JOIN customers ON orders.customer_id = customers.id [1] orders.status = 'shipped';
Drag options to blanks, or click blank then click option'
AOR
BAND
CNOT
DXOR
Attempts:
3 left
💡 Hint
Common Mistakes
Using OR would join rows that meet only one condition.
NOT and XOR are not valid for join conditions.
3fill in blank
hard

Fix the error in the join condition by choosing the correct operator.

SQL
SELECT * FROM orders INNER JOIN customers ON orders.customer_id [1] customers.id AND orders.region = customers.region;
Drag options to blanks, or click blank then click option'
A!=
BLIKE
C<>
D=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' or '<>' causes no matching rows.
LIKE is for pattern matching, not key equality.
4fill in blank
hard

Fill both blanks to join orders and customers on customer_id and region.

SQL
SELECT * FROM orders INNER JOIN customers ON orders.[1] = customers.id [2] orders.region = customers.region;
Drag options to blanks, or click blank then click option'
Acustomer_id
BAND
COR
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using OR instead of AND joins too many rows.
Using wrong column names causes errors.
5fill in blank
hard

Fill all three blanks to join orders and customers on customer_id, region, and status.

SQL
SELECT * FROM orders INNER JOIN customers ON orders.[1] = customers.id [2] orders.region = customers.region [3] orders.status = customers.status;
Drag options to blanks, or click blank then click option'
Acustomer_id
BAND
COR
Dorder_id
Attempts:
3 left
💡 Hint
Common Mistakes
Using OR causes incorrect joins with partial matches.
Using wrong column names causes errors.