0
0
SQLquery~10 mins

UPDATE without WHERE (danger) 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 of all employees to 50000.

SQL
UPDATE employees SET salary = [1];
Drag options to blanks, or click blank then click option'
A50000
BNULL
Csalary + 50000
D'50000'
Attempts:
3 left
💡 Hint
Common Mistakes
Putting the number 50000 in quotes, which makes it a string.
Using an expression like salary + 50000 which increases salary instead of setting it.
2fill in blank
medium

Complete the code to update the status of all orders to 'shipped'.

SQL
UPDATE orders SET status = [1];
Drag options to blanks, or click blank then click option'
Ashipped
BSHIPPED
C'shipped'
D"shipped"
Attempts:
3 left
💡 Hint
Common Mistakes
Not using quotes around the text value.
Using double quotes instead of single quotes.
3fill in blank
hard

Fix the error in the code to update all products' price to 10.99.

SQL
UPDATE products SET price = [1];
Drag options to blanks, or click blank then click option'
A'10.99'
B'10.99';
C10.99;
D10.99
Attempts:
3 left
💡 Hint
Common Mistakes
Including the semicolon inside the value.
Putting the number in quotes making it a string.
4fill in blank
hard

Fill both blanks to update the quantity of all items to 100 and the status to 'available'.

SQL
UPDATE inventory SET quantity = [1], status = [2];
Drag options to blanks, or click blank then click option'
A100
B'available'
Cavailable
D100.0
Attempts:
3 left
💡 Hint
Common Mistakes
Putting numbers in quotes.
Not putting text values in quotes.
5fill in blank
hard

Fill all three blanks to update the employees table: set salary to 60000, department to 'HR', and active to true.

SQL
UPDATE employees SET salary = [1], department = [2], active = [3];
Drag options to blanks, or click blank then click option'
A60000
B'HR'
CTRUE
D'true'
Attempts:
3 left
💡 Hint
Common Mistakes
Putting boolean values in quotes.
Not quoting text values.
Putting numbers in quotes.