HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
In SQLite, there is no TRUNCATE TABLE command, but you can use SQLiteDELETE command to delete all data from an existing table, but it is recommended to use DROP TABLE command to delete the entire table, and then re-create it again.
DELETE The basic syntax of the command is as follows:
sqlite> DELETE FROM table_name;
DROP TABLE basic syntax is as follows:
sqlite> DROP TABLE table_name;
If you use the DELETE TABLE command to delete all records, we recommend usingVACUUM command to clear the unused space.
Suppose COMPANY table have the following 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
Here is the delete table records Example:
SQLite> DELETE FROM COMPANY; SQLite> VACUUM;
Now, COMPANY records in the table is completely removed using a SELECT statement will not have any output.