DELETE statement in SQL


 DELETE


The DELETE statement is used to delete rows in a table.

Syntax:

DELETE FROM table_name
WHERE some_column=some_value

Note! Notice the WHERE clause in the DELETE syntax. The WHERE clause specifies which record or records that should be deleted. If you omit the WHERE clause, all records will be deleted!

Example:

delete from CUSTOMER where CustomerId=2 

Before delete:

Algae Services, Algae Study, Algae Education Services

After delete:

Algae Services, Algae Study, Algae Education Services

Delete All Rows:

It is possible to delete all rows in a table without deleting the table. This means that the table structure, attributes, and indexes will be intact:

DELETE FROM table_name

Note! Make sure to do this only when you really mean it! You cannot UNDO this statement!

Delete Data in the Designer Tools: 

You delete data in the designer by right-click on the row and select “Delete”:

Algae Services, Algae Study, Algae Education Services


No comments:
Write comments

Please do not enter spam links

Meet US

Services

More Services