Skip to content
SQLSimplified
BackendQuestion 45 / 52

Implementing Soft Deletes

Problem

For legal reasons, you cannot permanently erase employee data from the database even if they are fired. Instead of DELETE, you must update their deleted_at timestamp. Assume a deleted_at column exists. Write an UPDATE to set deleted_at = CURRENT_TIMESTAMP for employee_id = 1.

Database Schema

This problem acts as a scratchpad. You will write your own DDL/DML or conceptual queries, so there is no predefined schema.

Try It

Loading playground environment...

Hint

Solution