SQLite Database Introduction


SQLite is a relational database management system (RDBMS) contained in a C library that ends up being embedded into the end program. Many other database management systems have client–server database engines. SQLite does not. SQLite is ACID-compliant and implements most of the SQL standard, generally following PostgreSQL syntax.

Wikipedia says: “SQLite is a popular choice as embedded database software for local/client storage in application software such as web browsers. It is arguably the most widely deployed database engine, as it is used today by several widespread browsers, operating systems, and embedded systems (such as mobile phones), among others”.

SQLite is a really small database that is self-contained in one file. It’s small, but it’s a full ACID-compliant database.

DB Browser for SQLite

There is an open-source freeware visual tool for creating, designing and editing database files for SQLite called DB Browser for SQLite.

A Learning Resource in aWinForms Project

Here’s a good video called Using SQLite in C# – Building Simple, Powerful, Portable Databases for Your Application by Tim Corey on YouTube (IAmTimCorey). Here he is building a very simple program that allows you to add people to a list and have the list stored in a SQLite database. The project is a Windows WinForms project that uses the Dapper micro-ORM. He goes carefully and slowly by explaining all of the steps. This was what I needed because I was creating his project in a WPF project. Tim first builds the interface and then he begins to explain what SQLite is at time 4:30.

Some Features of SQLite

  • Write normal SQL commands (select, insert, update and delete)
  • Multiple tables
  • Create and use Views
  • Indexes
  • Transactions

Uses for SQLite

SQLite is not the database for large enterprise-wide data storage. It is an excellent choice for small projects or cases where you want to store a user’s preferences or options or configurations that pertain to that specific user. It is also excellent for prototype projects where you need to have a type of proof-of-concept for a project or part of a project. With SQLite, you don’t need to have the user install any heavy database like SQL Server or Oracle. These little personal databases are good for creating TODO lists or issue trackers, work order lists, software bug lists and so on. They are also good if you need to track your time and allocate your time to a project from a list of on-going projects, as in a time-and-expense program. It is also good for just creating a list of your personal expenses and or budget.