SQLite Data Types

This page introduces the data types used in SQLite.

Overview of SQLite Data Types

Unlike traditional relational database management systems (RDBMS) such as Oracle, SQL Server, or MySQL, SQLite assigns data types to values rather than strictly to columns. This means that specifying a column data type is not mandatory.

However, you can still declare column data types. In that case, SQLite will attempt to convert inserted values to the declared column type, much like other RDBMS systems.

In this guide, we will demonstrate how to use SQLite in a way that is as consistent as possible with typical RDBMS usage.


Supported Data Types in SQLite

In SQLite 3, the following storage classes (value data types) are supported:

SQLite Storage ClassDescription
NULLRepresents a NULL value
INTEGERSigned integer
REALFloating-point value
TEXTString value
BLOBBinary large object

In addition, SQLite 3 allows you to declare the following column data types:

SQLite Data TypeEquivalent in Other RDBMSDescription
INTEGERINT, BIGINT, etc.Integer values
NUMERICNUMERIC, DECIMALExact numeric values
REALDOUBLE, FLOATFloating-point values
TEXTCHAR, VARCHARString values
BLOBBLOBBinary large objects

Unsupported Data Types in SQLite

Some commonly used data types are not directly supported in SQLite. These must be converted into supported types for storage. Examples include:

Unsupported Data TypeHow to Store in SQLite
BOOL / BITConvert to 0 or 1 and store as INTEGER
DATETIMEConvert to TEXT (string) or store as INTEGER using Unix time

That's it — this was an overview of the data types in SQLite.