0
0
MySQLquery~10 mins

Why DML operations modify data in MySQL - Test Your Understanding

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

Complete the code to insert a new row into the employees table.

MySQL
INSERT INTO employees (name, age) VALUES ([1], 30);
Drag options to blanks, or click blank then click option'
A'John Doe'
BJohn Doe
C"John Doe"
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to use quotes around string values.
Using double quotes instead of single quotes.
2fill in blank
medium

Complete the code to update the age of an employee named 'Alice'.

MySQL
UPDATE employees SET age = 28 WHERE name = [1];
Drag options to blanks, or click blank then click option'
A'Alice'
BAlice
C"Alice"
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Not using quotes around string values in WHERE clause.
Using double quotes instead of single quotes.
3fill in blank
hard

Fix the error in the DELETE statement to remove employees older than 60.

MySQL
DELETE FROM employees WHERE age [1] 60;
Drag options to blanks, or click blank then click option'
A=
B>
C<
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong comparison operator.
Using equals instead of greater than.
4fill in blank
hard

Fill both blanks to select all employees with age {{BLANK_1}} 25 and name {{BLANK_2}} 'Bob'.

MySQL
SELECT * FROM employees WHERE age [1] 25 AND name = [2];
Drag options to blanks, or click blank then click option'
A>
B'Bob'
C'Alice'
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong comparison operator for age.
Not quoting the name string.
5fill in blank
hard

Fill all three blanks to update the salary to {{BLANK_1}} for employee {{BLANK_3}} with id {{BLANK_2}}.

MySQL
UPDATE employees SET salary = [1] WHERE id = [2] AND name = [3];
Drag options to blanks, or click blank then click option'
A50000
B101
C'Emma'
D'John'
Attempts:
3 left
💡 Hint
Common Mistakes
Quoting numeric values.
Not quoting string values in WHERE clause.