SQL DELETE QUERY - The Coding Shala
Home >> Learn SQL >> SQL DELETE QUERY
The following query will delete a row that has PersonID is 3 -
Other Posts You May Like
Please leave a comment below if you like this post or found some error, it will help me to improve my content.
SQL DELETE QUERY
The SQL 'DELETE' Query is used to delete existing rows from a table. We can use the 'WHERE' clause with 'DELETE' to delete the selected row if we don't use 'Where' then it will delete all the rows from a table.
SQL DELETE QUERY SYNTAX
The basic SQL DELETE query syntax is as follows -
DELETE FROM table_name WHERE condition;
SQL DELETE QUERY EXAMPLES
The following table Persons contains -
PersonID LastName FirstName Address City 1 Saini Akshay A-101 Pune 2 last first A-101 Pune 3 null Nikhil null null
The following query will delete a row that has PersonID is 3 -
SQL >> delete from Persons where PersonID = 3 Output >> PersonID LastName FirstName Address City 1 Saini Akshay A-101 Pune 2 last first A-101 Pune
- The following query will delete all the records from the 'Persons' table -
delete * from Persons
Other Posts You May Like
Prev<< SQL UPDATE QUERY NEXT >>SQL Alter Table
Comments
Post a Comment