SQL Delete – SQL TUTORIAL | Software Testing Material

SQL Delete Query:

The SQL Delete statement is used to delete records from a table.

Syntax:

Here the WHERE clause specifies which record should be deleted. If we didn’t mention WHERE clause then all the records will be deleted.

Example:

In the below screenshot, you could find the total number of records are ‘3′ related to first SELECT query where as the total number of records are just ‘2’ related to second SELECT query. We have executed the DELETE query to delete the record from ‘SCOREBOARD’ table where ‘Playername’ is equal to ‘Dravid’ and ‘Runs’ is equal to ‘20′. As per our table, we could find one record where both the conditions are matched. So that record was deleted.

SQL Delete

Delete all the records:

We could delete all the records at a time from a particular table using the below syntax. All rows in a table will be deleted but not table.

SQL DELETE Query To Delete All The Records Syntax :

The below syntax is used to delete all the records from the specified table.

In the next tutorial, we will see How To Use ALTER Query in SQL

Check out the complete SQL Tutorial by clicking on below link:

SQL Tutorial – Complete

Sharing is caring.

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

Like This Post?

We have a lot more where that came from?

We only send really good stuff occasionally, promise.

Rajkumar SM

Leave a Comment

Your email address will not be published. Required fields are marked *

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on whatsapp

Recent Posts:

Scroll to Top
API Testing eBook

DOWNLOAD FOR FREE