Table of Contents

SQLite - (Data Type|Affinities)

About

In SQLite:

Any column can store any type of data. It is just that some columns, given the choice, will prefer to use one storage class over another.

Inserted Integers are stored as integers regardless of the column type.

For instance:

Example

create table test("col1" DOUBLE PRECISION);
PRAGMA table_info(test)
insert into test values (2);
insert into test values ("2");
insert into test values ("t");
select typeof(col1) from test3;
select sum(col1) from test3;

(Data Type|Affinities)

Date is not an affinity. It can be stored as real, integer or text.

Documentation / Reference