SQLite DELETE Query is utilized to erase the current records from a table. You can utilize WHERE proviso with DELETE question to erase the chose columns, in any case all the records would be erased.
Syntax
Following is the fundamental language structure of DELETE inquiry with WHERE provision.
DELETE FROM table_name
WHERE [condition];
You can join N number of conditions utilizing AND OR administrators.
Example
Consider COMPANY table with the accompanying records.
ID NAME AGE ADDRESS SALARY
---------- ---------- ---------- ---------- ----------
1 Paul 32 California 20000.0
2 Allen 25 Texas 15000.0
3 Teddy 23 Norway 20000.0
4 Mark 25 Rich-Mond 65000.0
5 David 27 Texas 85000.0
6 Kim 22 South-Hall 45000.0
7 James 24 Houston 10000.0
Following is a model, which will DELETE a client whose ID is 7.
sqlite> DELETE FROM COMPANY WHERE ID = 7;
Presently COMPANY table will have the accompanying records.
ID NAME AGE ADDRESS SALARY
---------- ---------- ---------- ---------- ----------
1 Paul 32 California 20000.0
2 Allen 25 Texas 15000.0
3 Teddy 23 Norway 20000.0
4 Mark 25 Rich-Mond 65000.0
5 David 27 Texas 85000.0
6 Kim 22 South-Hall 45000.0
On the off chance that you need to DELETE all the records from COMPANY table, you don't have to utilize WHERE condition with DELETE question, which will be as per the following −
sqlite> DELETE FROM COMPANY;
Presently, COMPANY table doesn't have any record as all the records have been erased by DELETE proclamation.