DELETE Table in SQL

DELETE STATEMENT:- The DELETE statement is used to delete the existing records from the table.
You can use the WHERE clause with a DELETE query to delete the selected rows, otherwise, all records would be deleted.

SYNTAX:-

DELETE FROM table_name
WHERE condition;

EXAMPLE:-

Consider the STUDENTS table having the following records:-

The following query deletes a student record whose "ID =1":-
Example:-

DELETE FROM STUDENTS
WHERE StudentID = 1 ; 

OUTPUT:-

If you want to DELETE all the record from the table use the following syntax:-

DELETE FROM table_name ;


Comments

Popular posts from this blog

ASP.NET Overview

SQL AND ,OR, NOT Operators

SQL Joins