0
0
MySQLquery~20 mins

Why DML operations modify data in MySQL - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
DML Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What does a DML operation do?

Which of the following best describes the purpose of Data Manipulation Language (DML) operations in a database?

AThey backup and restore the entire database.
BThey modify the data stored in existing tables.
CThey control user access and permissions.
DThey create new tables and define their structure.
Attempts:
2 left
💡 Hint

Think about what happens when you add, change, or remove rows in a table.

query_result
intermediate
2:00remaining
Result of an UPDATE statement

Given the table employees with columns id, name, and salary, what will be the result of this query?

UPDATE employees SET salary = salary + 500 WHERE id = 3;

Assuming the employee with id = 3 had a salary of 3000 before, what will be the new salary?

AThe salary for employee 3 will be 3500.
BThe salary for employee 3 will be 500.
CThe salary for employee 3 will be 3000.
DThe query will cause a syntax error.
Attempts:
2 left
💡 Hint

Think about what the UPDATE statement does to the existing value.

📝 Syntax
advanced
2:00remaining
Identify the syntax error in DELETE statement

Which option contains a syntax error in the DELETE statement?

DELETE FROM employees WHERE;
ADELETE FROM employees WHERE name = 'John';
BDELETE FROM employees WHERE id = 5;
C;5 = di EREHW seeyolpme MORF ETELED
DDELETE FROM employees WHERE;
Attempts:
2 left
💡 Hint

Check if the WHERE clause is complete and valid.

optimization
advanced
2:00remaining
Optimizing multiple UPDATEs

You want to increase the salary by 10% for all employees in the sales department. Which query is the most efficient?

AUPDATE employees SET salary = salary * 1.1 WHERE department = 'sales';
BUPDATE employees SET salary = salary + salary * 0.1 WHERE department = 'sales';
CUPDATE employees SET salary = salary + 10 WHERE department = 'sales';
DUPDATE employees SET salary = salary * 1.1;
Attempts:
2 left
💡 Hint

Consider which query updates only the needed rows and calculates the increase correctly.

🔧 Debug
expert
2:00remaining
Why does this INSERT fail?

Consider this INSERT statement:

INSERT INTO employees (id, name, salary) VALUES (1, 'Alice');

Why does this query fail?

ABecause the VALUES keyword is misspelled.
BBecause the id value 1 is already used.
CBecause the salary column is missing a value and has no default.
DBecause the table employees does not exist.
Attempts:
2 left
💡 Hint

Check if all columns listed have matching values.