SQLite Database: How to Create, Open, Backup & Drop Files

SQLite databases are very lightweight. Unlike other database systems, there is no configuration, installation required to start working on an SQLite Open database.

What you need is the SQLite library which is less than 500KB size. We will jump start working on SQLite databases and tables directly.

In this SQLite tutorial, you will learn how to access SQLite database and use it-

SQLite CREATE Database

Unlike other database management systems, there is no CREATE DATABASE command in SQLite. In this SQLite tutorial, here is how you can create a new database:

Sqlite Database Tutorial

Sqlite Database Tutorial

SQLite CREATE Database in a Specific Location using Open

If you want to learn how to open SQLite file and create the database file in a specific location rather than in the same location where the sqlite3.exe is located, here is how to view SQLite database:

SQLite create a database and populate it with tables from a file

If you have a .SQL file that contains the tables schema and you want to create a new database with the same tables from that file, in the following example, we will explain how to do this.

Example:

In the following example, we will create the sample database. We will use this sample database throughout the SQLite tutorial, with the name "SQLiteTutorialsDB" and populate it with the tables. As following:

SQLite Backup & Database

To back up a database, you have to open that database first as follows:

SQLite Drop Database

Unlike other Database management systems, there is no DROP DATABASE SQLite command. If you want to drop database SQLite, all you have to do is to delete the database file.

Notes:

 

YOU MIGHT LIKE: