0
0
MySQLquery~10 mins

UPDATE with JOIN in MySQL - Interactive Code Practice

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

Complete the code to update the salary of employees by joining with the departments table.

MySQL
UPDATE employees e JOIN departments d ON e.department_id = d.id SET e.salary = e.salary * 1.1 WHERE d.name = [1];
Drag options to blanks, or click blank then click option'
A'sales'
BSales
C"Sales"
D'Sales'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to use quotes around string values.
Using double quotes instead of single quotes for strings.
2fill in blank
medium

Complete the code to update the status of orders by joining with the customers table.

MySQL
UPDATE orders o JOIN customers c ON o.customer_id = c.id SET o.status = 'shipped' WHERE c.country = [1];
Drag options to blanks, or click blank then click option'
A'USA'
Busa
C"USA"
DUSA
Attempts:
3 left
💡 Hint
Common Mistakes
Using unquoted strings for string values.
Using double quotes instead of single quotes.
3fill in blank
hard

Fix the error in the code to update product prices by joining with the categories table.

MySQL
UPDATE products p [1] categories c ON p.category_id = c.id SET p.price = p.price * 0.9 WHERE c.name = 'Electronics';
Drag options to blanks, or click blank then click option'
AJOIN
BJOIN ON
CINNER JOIN
DLEFT JOIN
Attempts:
3 left
💡 Hint
Common Mistakes
Adding extra keywords like 'ON' after JOIN.
Using INNER JOIN which is valid but not required here.
4fill in blank
hard

Fill both blanks to update employee titles by joining with the roles table.

MySQL
UPDATE employees e [1] roles r [2] e.role_id = r.id SET e.title = CONCAT('Senior ', e.title) WHERE r.level = 'Manager';
Drag options to blanks, or click blank then click option'
AJOIN
BON
CWHERE
DUSING
Attempts:
3 left
💡 Hint
Common Mistakes
Using WHERE instead of ON for join condition.
Using USING keyword incorrectly here.
5fill in blank
hard

Fill all three blanks to update the stock quantity by joining products and suppliers.

MySQL
UPDATE products p [1] suppliers s [2] p.supplier_id = s.id SET p.stock = p.stock + [3] WHERE s.region = 'North';
Drag options to blanks, or click blank then click option'
AJOIN
BON
C10
DWHERE
Attempts:
3 left
💡 Hint
Common Mistakes
Using WHERE instead of ON for join condition.
Forgetting to provide a numeric value for stock increment.