Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

SQLite Introduction

SQLite Introduction

This tutorial helps you understand what SQLite is, how it differs from SQL, why it is needed, and its approach to application database processing.

SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the fastest-growing database engine in terms of popularity, regardless of its size. SQLite source code is not subject to copyright restrictions.

What is SQLite?

SQLite is an in-process library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. It is a zero-configuration database, which means that unlike other databases, you do not need to configure it in your system.

Like other databases, the SQLite engine is not a standalone process and can be statically or dynamically linked according to application needs. SQLite directly accesses its storage files.

Why use SQLite?

History

  1. 2000 -- D. Richard Hipp designed SQLite so that programs could operate without administration.

  2. 2000 -- In August, SQLite 1.0 was released with the GNU Database Manager.

  3. 2011 -- Hipp announced the addition of the UNQl interface to SQLite DB, developing UNQLite (a document-oriented database).

SQLite Limitations

In SQLite, the following features of SQL92 are not supported:

Feature Description
RIGHT OUTER JOIN Only LEFT OUTER JOIN is implemented.
FULL OUTER JOIN Only LEFT OUTER JOIN is implemented.
ALTER TABLE The RENAME TABLE and ALTER TABLE ADD COLUMN variant commands are supported; DROP COLUMN, ALTER COLUMN, and ADD CONSTRAINT are not supported.
Trigger support FOR EACH ROW triggers are supported, but FOR EACH STATEMENT triggers are not.
VIEWs In SQLite, views are read-only. You cannot execute DELETE, INSERT, or UPDATE statements on a view.
GRANT and REVOKE The only access permissions that can be applied are the normal file access permissions of the underlying operating system.

SQLite Commands

The standard SQLite commands for interacting with a relational database are similar to SQL. The commands include CREATE, SELECT, INSERT, UPDATE, DELETE, and DROP. These commands can be divided into the following categories based on the nature of their operations:

DDL - Data Definition Language

Command Description
CREATE Create a new table, a view of a table, or other objects in the database.
ALTER Modify an existing database object in the database, such as a table.
DROP Delete an entire table, a view of a table, or other objects in the database.

DML - Data Manipulation Language

Command Description
INSERT Create a record.
UPDATE Modify a record.
DELETE Delete a record.

DQL - Data Query Language

Command Description
SELECT Retrieve certain records from one or more tables.