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' ;
Select Command
Distinct clause with Select Command
Where clause In SQL
Logical Operator in SQL SELECT Statement
IN Operator in SQL
BETWEEN Operator in SQL
Use of Wildcards in SQL
LIKE Operator in SQL
ORDER BY Clause in SQL
GROUP BY Clause in SQL
HAVING Clause in SQL
ALIAS In SQL
AS Keyword In SQL
INSERT INTO Command In SQL
Inserting Record In to a Table Form an other Table In SQL
UPDATE Command in SQL
DELETE Command in SQL
AVG Function in SQL