Using DB Browser for SQLite

Note: instructions are provided for MS Windows, for other systems the steps should be similar.

Prepare a CSV file with your data set

  1. the first line should be used for data headers (meaningful names, no spaces)
  2. remove any extra spaces or unwanted characters
  3. check for data validity

Download "DB Browser for SQLite"

Go to https://sqlitebrowser.org/

In the "Download" section, click on the "DB Browser for SQLite - .zip (no installer) for 64-bit Windows" link.

Unzip the file.

Create your database file

Navigate to locate the "DB Browser for SQLite.exe" file and double-click on it.

Click on the "New Database" button.

Define the file name and location for your database file (example: C:\Users\janedoe\Desktop\database.sqlite).

A "Edit table definition" window will automatically appear; click on the "Cancel" button.

Import the CSV file

In the "File" menu, under "Import", click on the "Table from CSV file" command.

Select your CSV file.

In the "Import CSV file" window:

  1. define the table name
  2. check the "column names in the first line" box
  3. review the data entries displayed to make sure that the proper values are displayed
  4. click on the "OK" button

Check and save the database file

Once the import operation is completed, you can go to the "Browse Data" tab to check on your data set.

Click on the "Write Changes" button to save your SQLite file. The file extension should be .sqlite.

You can also use the "Execute SQL" tab to run SQL commands before using those commands in your PHP code.