Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to update the salary column to 5000.
SQL
UPDATE employees SET salary = [1] WHERE id = 3;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Putting quotes around numbers causing type errors.
Using column name instead of a value.
✗ Incorrect
The salary column should be set to the numeric value 5000 without quotes.
2fill in blank
mediumComplete the code to update the name column to 'Alice'.
SQL
UPDATE employees SET name = [1] WHERE id = 1;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around string values.
Using double quotes instead of single quotes.
✗ Incorrect
String values in SQL must be enclosed in single quotes.
3fill in blank
hardFix the error in the code to update both name and salary columns.
SQL
UPDATE employees SET name = 'Bob', salary = [1] WHERE id = 2;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around numeric values causing errors.
Using column names instead of values.
✗ Incorrect
Numeric values should not be in quotes when updating numeric columns.
4fill in blank
hardFill both blanks to update name to 'Carol' and salary to 7000.
SQL
UPDATE employees SET name = [1], salary = [2] WHERE id = 4;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around numbers.
Forgetting quotes around strings.
✗ Incorrect
Strings need single quotes; numbers do not.
5fill in blank
hardFill all three blanks to update name to 'Dave', salary to 8000, and department to 'Sales'.
SQL
UPDATE employees SET name = [1], salary = [2], department = [3] WHERE id = 5;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around numbers.
Forgetting quotes around strings.
Using unquoted strings causing syntax errors.
✗ Incorrect
Strings must be in single quotes; numbers must not.