Deleting Data

Syntax: To remove records from a table:

DELETE FROM table_name WHERE condition;

Example

DELETE FROM employees WHERE employee_id = 1;

Truncating a Table: To delete all records without logging each row:

TRUNCATE TABLE table_name;

Example:

TRUNCATE TABLE employees;

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *