TechnoLearnAcademy

TECHNOLEARN

SQL DELETE Statement

The SQL DELETE statement is used to remove rows from a table based on a specified condition. It allows you to delete one         or more records from a table that meets the criteria you define.

Syntax:      

                DELETE FROM table_name WHERE condition;
Note: If you omit the WHERE clause, all rows in the table will be deleted.
Let’s understand the delete clause with an example.
         Table Emp

Example:

   Objective: In this example, we will delete records with the ecode value of 1050 from the emp table. 
                      DELETE FROM Tbl_Emp                                                                                                                                                                                   WHERE Ecode = 1050;

Example:

   Objective: In this example, we will delete all the records from the emp table.
                      DELETE FROM Tbl_Emp;
Scroll to Top