Complete the code to select all active users who are not soft deleted.
SELECT * FROM users WHERE [1] = 0;
The column is_deleted is commonly used to mark soft deleted rows. Rows with is_deleted = 0 are active.
Complete the code to soft delete a user by setting the soft delete flag.
UPDATE users SET [1] = 1 WHERE user_id = 42;
To soft delete, set is_deleted to 1 for the target user.
Fix the error in the query to select only non-deleted products.
SELECT * FROM products WHERE [1] = 0;
The correct column to check is is_deleted. Using is_deleted = 0 filters active rows.
Fill both blanks to select all active orders and sort them by creation date descending.
SELECT * FROM orders WHERE [1] = 0 ORDER BY [2] DESC;
Use is_deleted = 0 to filter active orders and created_at to sort by creation date.
Fill all three blanks to insert a new user with soft delete flag set to active (not deleted).
INSERT INTO users (username, email, [1]) VALUES ([2], [3], 0);
Insert the is_deleted column with value 0 to mark the user as active. Provide username and email as strings.