is your friend- please use it…
There are examples on this forum (some by me) on how to write to an SQLite database The short answer is that you use either an INSERT or an UPDATE query, depending if they are new records, or updating existing ones
INSERT
UPDATE
Refer: