Simple Way To Create Sqlite Database


One of the biggest dilemmas before starting the implementation of a new project is the choice of the technology of the database. 

In some projects, we need just to store data in an embedded DB in the application with a minimal set of security without needing to install a DBMS with several DB services or processes that can complexify the environment without any need. In these cases, Sqlite can be the best choice.


  • SqliteStudio: Sqlite Studio is a tool that allows to perform several operations on a Sqlite database (creation, update, export ...) and it gives the possibility to do it using scripting or the user interface. It can be downloaded from the following link

Step 1: Download SqliteStudio

Once you download the sqliteStudio, you will get a binary folder that contains all the needed DLLs and the exe.

Store it in a directory of your choice.

Step 2: Create the database

To create a database you need to open the command line and then navigate to your SqliteStudio's folder.

Simple Way To Create Sqlite Database

Once you are in the folder of binaries, you can use the sqlitestudiocli.exe to create your database. let's suppose that we are building a products database.

So type the command as follows, and your DB will be created in the same folder.

Type Ctrl+C to leave.

Simple Way To Create Sqlite Database

Step 3: Add your database using Sqlite studio

Now go to your downloaded folder and open the SQLiteStudio.exe and then click the icon to add the database

Simple Way To Create Sqlite Database

Then browse your folders to add your DB.In our case products.db

Simple Way To Create Sqlite Database 

Step 4: Create your tables

Once you added the DB you should have it in your databases list, Select it and click the icon to add a table

Simple Way To Create Sqlite Database

Step 5: Create the table structure

You are in the tab Structure of the table, you can add your needed columns with their types. You can also add a constraint if needed.

For example for the following screenshot, we are creating the barcode column having the type varchar and it's a primary key

Simple Way To Create Sqlite Database

Step 6: Commit your changes

Once you have created all your needed columns, you can commit your changes and then they will be effective

Simple Way To Create Sqlite Database

Once the script will be shown on the screen, confirm it.

If no error occurs you will have the following message in the status area.

Simple Way To Create Sqlite Database

You can switch to the tab data to refresh, add, delete your database's data 

Simple Way To Create Sqlite Database


This article showed how to create a basic database with only one table.

The most important challenge is to have a good model that simplifies the design on the applicative side and also simplifies the mapping to your application's object using an ORM.

Recommended Ebook

Introduction to Mongo DB

Download Now!
Similar Articles