DELETE Command in SQL
By S.Qasim
Published: 14 May 2013
SQL DELETE Command
DELETE Command in SQL
DELETE command is used to remove the record form specified table. You can delete all record at a time and also Remove a specific record with the help of WHERE clause. The FROM keyword is used with delete command.
Syntax is :
DELETE FROM Table-Name
WHERE column-name=Condition ;
For example if you want to delete all record from table below:
TABLE_A
| Name | Course_Title | Contact No | City |
| Mr. Muneer | DIT | 999999 | Karachi |
| Mr. Naweed | PDP | 222222 | Lahore |
| Mr.tauqeer | DIT | 333333 | Karachi |
| Mr. Jalil | DIT | 222222 | Islamabad |
DELETE FROM Table-A ;
You can also use
DELETE * FROM Table-A ;
But if you want to delete some specific record then use DELETE FROM statement with WHERE clause. For example delete those record whose city is Karachi.
DELETE FROM Table-A
WHERE City = 'Karachi' ;