SQL DELETE FROM Statement
By Hemanta Sundaray on 2022-12-15
The DELETE FROM statement deletes one or more rows from a table. You can use the statement when you want to delete existing records.
The statement below deletes all records in the students table with no blood_group:
DELETE FROM students
WHERE blood_group IS NULL;
DELETE FROM is a clause that lets you delete rows from a table.
students is the name of the table we want to delete rows from.
WHERE is a clause that lets you select which rows you want to delete. Here we want to delete all of the rows where the blood_group column IS NULL.
IS NULL is a condition in SQL that returns true when the value is NULL and false otherwise.