When you insert data into your table you may need to update it sometimes. Not so often we inserted or updated a wrong data. That’s why there is a Delete statement.
To delete some record from the database tables we use the SQL Delete statement, the Delete Statement deletes the data row from the table which meets the condition specified in the where clause.
The delete command has the following syntax:
Consider that we want to delete all the users from the table who are married, and then the delete statement will be like:
The resulting data of users table will be as
Similarly we can delete some row with multiple conditions.
Say we want to delete users who are from france and are single then the SQL delete statement will be like:
The resulting data will be like:
Never ever forget to write the where clause in the delete command, if you accidently forgot to include the where clause in the delete command then all the data of the table will be flushed (wiped away).
Consider this example:
Then all data will be erase.
So, you can simply exclude the where clause if you wish to erase all the data from the table.