Complete the code to update the salary of employees in the 'employees' table.
UPDATE employees SET salary = salary [1] 1000 WHERE department = 'Sales';
The '+' operator increases the salary by 1000 for employees in the Sales department.
Complete the code to update the status of orders to 'shipped' only for orders with status 'pending'.
UPDATE orders SET status = 'shipped' WHERE status [1] 'pending';
The '=' operator selects orders where the status is exactly 'pending' to update them to 'shipped'.
Fix the error in the UPDATE statement that tries to set all product prices to 0 but accidentally omits the WHERE clause.
UPDATE products SET price = [1];Setting price to 0 is valid, but omitting WHERE updates all rows. Use caution to avoid unintended mass updates.
Fill both blanks to update the 'quantity' by subtracting 1 only for items where quantity is greater than 0.
UPDATE inventory SET quantity = quantity [1] 1 WHERE quantity [2] 0;
Subtract 1 from quantity only if quantity is greater than 0 to avoid negative values.
Fill all three blanks to update the 'status' to 'inactive' and set 'last_updated' to current date only for users with 'active' status and last login before 2023-01-01.
UPDATE users SET status = [1], last_updated = [2] WHERE status = [3] AND last_login < '2023-01-01';
This updates only active users who last logged in before 2023-01-01, setting their status to inactive and recording the update date.