In SQLite, DELETE query is used to delete the existing records from a table. You can use it with WHERE clause or without WHERE clause. WHERE clause is used to delete the specific records (selected rows), otherwise all the records would be deleted.
DELETE FROM table_name WHERE [conditions....................];;
We have an existing table named "STUDENT", having the following data:
Delete the records of a student from "STUDENT" table where ID is 4.
DELETE FROM STUDENT WHERE ID = 4;
The student's record of id 4 is deleted; you can check it by using SELECT statement:
SELECT * FROM STUDENT;
If you want to delete all records from the table, don't use WHERE clause.
DELETE FROM STUDENT;
You can see that there is no data in the table "STUDENT".