If you wish to delete all of the records from a table in an
SQLite
database, you can do so using a command in the form delete from
tableName
where tableName is the name of the
table from which you wish to remove all of the rows in the table.
E.g., if I wished to delete all of the records in a table named
TimeStamps, I could use the delete command below.
sqlite> select * from Timestamps; 2025-05-01 21:26:22|2025-05-01 21:23|10947739 2025-05-01 21:28:33|2025-05-01 21:28|10967247 2025-05-04 13:37:47|2025-05-04 13:36|18079581 sqlite> delete from Timestamps; sqlite> select * from Timestamps; sqlite>
If I only wanted to delete a record or records meeting a specific condition, I could specify that condition in a WHERE clause. E.g., if the columns in the table were CurrentTimestamp, LastUpdateTimestamp, and Size and I only wanted to remove the row where the value of CurrentTimestamp is 2025-05-04 13:37:47, I could use the command below, instead.
sqlite> .schema Timestamps CREATE TABLE "Timestamps" ( "CurrentTimestamp" TEXT NOT NULL, "LastUpdateTimestamp" TEXT NOT NULL, "Size" INTEGER NOT NULL ); sqlite> delete from Timestamps where CurrentTimestamp='2025-05-04 13:37:47';