Latest Post

Saturday, 24 September 2016

How to delete records in sql


 DELETE statement  is used to removes one or more rows in a table or view.

Syntax:-

DELETE FROM your_table_name WHERE column=some_value;

Example:-

Following is the table "Employee" where we will apply the delete statement

Id
Name
Age
Address
1
Alok Kumar Singh
30
IN
2
Tomas Paul
45
NZ
3
Cristomfer Dee
85
AU
4
Niel Macengi
55
US




            


Delete query
     
Delete from employee where Id=4

Id
Name
Age
Address
1
Alok Kumar Singh
30
IN
2
Tomas Paul
45
NZ
3
Cristomfer Dee
85
AU



  


We can remove all the rows from the table by below  delete query

Delete from employee

Government Jobs