Getting Started with SQLite3 - Basic Commands

Originally published at: http://www.sitepoint.com/getting-started-sqlite3-basic-commands/

SQLite is a C library that implements an SQL database engine. It is a Relational Database Management System (or RDBMS). Most of the SQL databases work with the client/server model. Take MySQL for an example. To enter and receive data from a MySQL database you need to send a request to the MySQL server, which on reception will provide you with the appropriate response. Contrary to MySQL, SQLite databases are operated directly from the disk. There is no need to create requests to the server.

SQLite370.svg (Custom)

Installation

We will operate on our database using the sqlite31 Command Line Interface(CLI). We will work under the Linux Platform. sqlite3 CLI for MAC OS and Windows are just the same, but for the sake of consistency, it’s recommended you install Homestead Improved – a lightweight VM runnable in 5 minutes that will keep your computer clean of extra unneeded software.

To install it on Homestead Improved (or any Debian based OS like Ubuntu), run the following:

sudo apt-get install sqlite3 libsqlite3-dev

This will install sqlite3. To install it on other platforms, follow their official instructions. After it is installed we can start the session. Open the Terminal/Command Line and enter the command sqlite3. You must see something of this kind :

CLI sqlite3

The second line tells you to enter .help for instructions. There is a prompt waiting for you to type a command. So go ahead and enter .help. This will give you a list of Meta Commands and their descriptions.

Continue reading this article on SitePoint

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.