SQL DELETE Category


SQL DELETE Category

The Delete Statement in SQL is used to delete existing records in the table. We may delete one or more records depending on the context in which we describe YOUR clause.

Basic syntax:

REMOVE TABLE_name WHERE some_condition;

table_name: table name
some_condition: condition Selecting a specific record.
Note: We may delete one and more records depending on the context in which we provide YOUR clause. If we leave the YOUR clause, all records will be deleted, and the table will be empty.
Deleting one record: Delete lines where NAME = ‘Ram’. This will only delete the first line.
REMOVE From Reader WHERE NAME = 'Ram';

Deleting multiple records: Delete lines on Student table when 20 years. This will remove 2 rows (third row and fifth row).
SUBSCRIBE TO STUDENT WHEN Age = 20;
Delete all records: There are two questions to do this as shown below,

question 1: "SUBSCRIBE TO STUDENT";

question 2: "Delete * from Student";