Skip to main content

How do you delete a record in a table?

Deleting a record from a table is done with the DELETE command.

Syntax:

sql
DELETE FROM Table_Name WHERE Condition;

Example:

sql
DELETE FROM Employees WHERE ID = 1;

Explanation:

  • DELETE FROM Employees, picks the table to delete a record from.
  • WHERE ID = 1, specifies the condition for which record to delete (without WHERE, every record in the table gets deleted).

Notes

  • Using WHERE is essential when specific records need to be deleted.
  • Once deleted, a record is irreversibly removed, unless a transaction with ROLLBACK is used.

Put simply, DELETE is the SQL command for removing one or several records from a table based on a given condition.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.