0
0
SQLquery~10 mins

INNER JOIN syntax 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 select all columns from two tables using INNER JOIN.

SQL
SELECT * FROM employees [1] departments ON employees.department_id = departments.id;
Drag options to blanks, or click blank then click option'
AINNER JOIN
BOUTER JOIN
CLEFT JOIN
DJOIN
Attempts:
3 left
💡 Hint
Common Mistakes
Using LEFT JOIN instead of INNER JOIN returns unmatched rows too.
Using JOIN alone may work but INNER JOIN is clearer.
2fill in blank
medium

Complete the code to join orders with customers on customer_id.

SQL
SELECT orders.id, customers.name FROM orders [1] customers ON orders.customer_id = customers.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 LEFT JOIN returns all orders even without customers.
Using FULL JOIN returns unmatched rows from both tables.
3fill in blank
hard

Fix the error in the INNER JOIN syntax to correctly join products and categories.

SQL
SELECT products.name, categories.name FROM products [1] categories ON products.category_id = categories.id;
Drag options to blanks, or click blank then click option'
AINNER JOIN ON
BINNER JOIN
CJOIN ON
DINNER JOIN WHERE
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting ON causes syntax error.
Using WHERE instead of ON for join condition is incorrect.
4fill in blank
hard

Fill both blanks to join sales and stores on store_id and select sale amount and store name.

SQL
SELECT sales.amount, stores.[1] FROM sales [2] stores ON sales.store_id = stores.id;
Drag options to blanks, or click blank then click option'
Aname
BINNER JOIN
CLEFT JOIN
Dlocation
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting a wrong column from stores.
Using LEFT JOIN instead of INNER JOIN changes the result.
5fill in blank
hard

Fill all three blanks to join employees and salaries on employee_id and select employee name, salary, and department.

SQL
SELECT employees.[1], salaries.[2], employees.[3] FROM employees INNER JOIN salaries ON employees.id = salaries.employee_id;
Drag options to blanks, or click blank then click option'
AINNER JOIN
Bsalary
Cname
Ddepartment
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up column names or tables.
Using wrong join type or missing ON keyword.