SQL DELETE Statement
Introduction
SQL DELETE Statement is used to delete one or multiple rows from table.
Syntax:
DELETE FROM table_name
WHERE [Condition];
Example : Query using DELETE Statement.
Consider the following table titled 'Clients'.
Client_ID | Last_Name | First_Name | Contact | Country |
---|
1 | Thomas | Alex | 2400000 | USA |
2 | Cruise | Martin | 5600000 | USA |
3 | Pandit | Prajakta | 34542892 | India |
1. Write a query to delete row where, Client_ID= 2.
DELETE FROM Clients
WHERE
Client_ID = 2;
The result is shown in the following table.
Client_ID | Last_Name | First_Name | Contact | Country |
---|
1 | Thomas | Alex | 2400000 | USA |
3 | Pandit | Prajakta | 34542892 | India |
2. Write a query to delete all rows from the table.
DELETE FROM Clients;
The result is shown in the following table.
Client_ID | Last_Name | First_Name | Contact | Country |
---|