0
0
SQLquery~10 mins

UPDATE single column 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 update the salary column to 50000 for all employees.

SQL
UPDATE employees SET salary = [1];
Drag options to blanks, or click blank then click option'
Asalary
B'50000'
C50000
DNULL
Attempts:
3 left
💡 Hint
Common Mistakes
Putting numeric values inside quotes, which makes them strings.
Using the column name instead of a value.
2fill in blank
medium

Complete the code to update the status column to 'active' for employees with id 10.

SQL
UPDATE employees SET status = [1] WHERE id = 10;
Drag options to blanks, or click blank then click option'
A'active'
Bactive
C"active"
DACTIVE
Attempts:
3 left
💡 Hint
Common Mistakes
Using unquoted strings which causes syntax errors.
Using double quotes which may not be supported in all SQL dialects.
3fill in blank
hard

Fix the error in the code to update the age column to 30 for user with username 'john'.

SQL
UPDATE users SET age = [1] WHERE username = 'john';
Drag options to blanks, or click blank then click option'
Aage
B30
C'30'
DNULL
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around numbers causing type mismatch.
Using the column name instead of a value.
4fill in blank
hard

Fill both blanks to update the price column to 19.99 for product with id 5.

SQL
UPDATE products SET price = [1] WHERE id [2] 5;
Drag options to blanks, or click blank then click option'
A19.99
B=
C>
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using comparison operators other than '=' in WHERE clause.
Putting numeric values in quotes.
5fill in blank
hard

Fill all three blanks to update the quantity column to 100 for order with order_id 200 and status 'pending'.

SQL
UPDATE orders SET quantity = [1] WHERE order_id [2] [3] AND status = 'pending';
Drag options to blanks, or click blank then click option'
A100
B=
C200
D'pending'
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around numbers.
Using wrong comparison operators.
Confusing status with order_id in WHERE clause.