Javatpoint Logo
Javatpoint Logo

SQLite Create Database

In SQLite, the sqlite3 command is used to create a new database.

Syntax:

Your database name should be unique within the RDBMS.

Note: The sqlite3 command: The sqlite3 command is used to create database. But, if the database does not exist then a new database file with the given name will be created automatically.

How to create database:

First open command prompt and set the path. After that you can check that sqlite directory by using "dir" command.

SQLite Create database 1

Example:

Let's create a database name "JTP.db":

SQLite Create database 2

The database is created now. You can check the created database by using the ".databases" command.

SQLite Create database 3

You can see the created database in also in the root folder.

SQLite Create database 4

The .quit Command

The SQLite .quit command is used to be come out of the sqlite prompt:

.quit

The .dump Command

The .dump dot command is used to export complete database in a text file by using SQlite command at command prompt.

For example:

SQLite Create database 5

Now, the complete database is exported in a text file. You can see it in the root folder.

SQLite Create database 6




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA