Delete Statement in SQL

Delete Statement in SQL

1. Create Table

CREATE TABLE Employee
(
   Id int,
   Name varchar(20),
   City varchar(20)
);

2. Insert Values in Table.

insert into Employee values('1','Spiderman','Varanasi')

3.Print Table

select * from Employee

The DELETE command is used to delete existing records in a table.


The following SQL statement deletes the Employee  " Name='Thor' "

from the "Employee" table.


Delete From Employee Where name='Thor';




The following SQL statement deletes all rows in the "Employee" table, without deleting the table.

This means that the table structure, attributes, and indexes will be
intact.

Delete From Employee;






 



Contact us for software training, education or development










 

Post a Comment

0 Comments

Me