DML Commands in SQL Server: DELETE

DML : Data Manipulation Language.

In the earlier sessions , we have discussed about the following DML Commands:
DELETE is a DDL command which is used to delete or remove data from a table.
In simple terms DELETE Command deletes data from tables.

Syntax for DELETE Command is as follows:

DELETE FROM <Table Name>

Example:

Assume that we have a table (MYPASSWORDS) with the following information. This table contains list of my email ids and corresponding passwords.
<>
ACCOUNTACCOUNTIDPWD
GMAILcatchme@gmail.comasderuom09
GMAILsqldeveloper@gmail.comsqlpor739
GMAILsqldeveloper@gmail.comsqlpor739
YAHOLmyyahooid@yahoo.comolju67
YAHOLsqlmyid@yahoo.comitryry67


Here is the query which can be used to delete (remove) data from MYPASSWORDS table.

DELETE FROM MYPASSWORDS

Below screen shot contains the data from MYPASSWORDS table before and after the execution of DELETE query:














That is after executing DELETE command on MYPASSWORDS table, data is deleted or removed from that table.

Summary:

This article explains about How DELETE Command can be used in SQL SERVER.

This entry was posted in . Bookmark the permalink.

Leave a reply