SQLite - CREATE Database - Tutorialspoint
Maybe your like
In SQLite, sqlite3 command is used to create a new SQLite database. You do not need to have any special privilege to create a database.
Syntax
Following is the basic syntax of sqlite3 command to create a database: −
$sqlite3 DatabaseName.dbAlways, database name should be unique within the RDBMS.
Example
If you want to create a new database <testDB.db>, then SQLITE3 statement would be as follows −
$sqlite3 testDB.db SQLite version 3.51.1 2025-11-28 17:28:25 Enter ".help" for usage hints. sqlite>The above command will create a file testDB.db in the current directory. This file will be used as database by SQLite engine. If you have noticed while creating database, sqlite3 command will provide a sqlite> prompt after creating a database file successfully.
Once a database is created, you can verify it in the list of databases using the following SQLite .databases command.
sqlite>.databases main: D:\sqlite\testDB.db r/wYou will use SQLite .quit command to come out of the sqlite prompt as follows −
sqlite>.quit $The .dump Command
You can use .dump dot command to export complete database in a text file using the following SQLite command at the command prompt.
$sqlite3 testDB.db .dump > testDB.sqlThe above command will convert the entire contents of testDB.db database into SQLite statements and dump it into ASCII text file testDB.sql. You can perform restoration from the generated testDB.sql in a simple way as follows −
$sqlite3 testDB.db < testDB.sqlAt this moment your database is empty, so you can try above two procedures once you have few tables and data in your database. For now, let's proceed to the next chapter.
Print Page Previous Next AdvertisementsTag » How To Populate Sqlite Database
-
SQLite How To Create A Database And Insert Data - Linux Hint
-
Java - Populating SQLite Database - Stack Overflow
-
SQLite3 Databases: Creating, Populating And Retrieving Data, Part 1
-
How To Pre Populate Database In Android Using SQLite Database
-
How To Create And Populate A SQLite Users Table With ... - YouTube
-
SQLite In 5 Minutes Or Less
-
Auto Populate From Sqlite Database - Microsoft Q&A
-
Populate A SQLite Database - Using Entity Framework Core With ...
-
Best Way To Populate Sqlitedatabase With Initial Data
-
SQLite Insert Into - Inserting New Rows Into A Table
-
SQLite Database: How To Create, Open, Backup & Drop Files - Guru99
-
Save Data Using SQLite - Android Developers
-
How To Populate ExpandableListView Using Sqlite Database - Quora
-
How To Create A Database Using SQLite - FutureLearn