# Databases : SQLite \[ [src](https://sqlite.org/src/timeline/) | [mirror](https://github.com/sqlite/sqlite/) | [docs](https://sqlite.org/docs.html) | [index](https://sqlite.org/keyword_index.html) ] ## Overview Uses dynamic typing. The declared type of a column is used to determine the affinity of the column only. > [!NOTE] Static Typing > Update: As of version 3.37.0 (2021-11-27), SQLite provides STRICT tables that do rigid type enforcement, for developers who prefer that kind of thing. ## Types Doesn't have types — has **storage classes** (dynamic / based on currently stored value) and **type affinities** (assigned to columns based on declared type name). ``` Storage Classes: NULL, TEXT, INTEGER, REAL, BLOB Type Affinities: TEXT -> uses NULL, TEXT, or BLOB (numbers converted to TEXT) NUMERIC -> uses all five storage classes (un-convertible text remains text, else INTEGER or REAL) INTEGER -> same behavior as NUMERIC REAL -> same behavior as NUMERIC except coerces ints to real BLOB Column Affinity based on Declared Type Name: contains "INT" -> INTEGER contains "CHAR" or "TEXT" -> TEXT contains "BLOB" or not specified -> BLOB contains "REAL", "FLOA", or "DOUB" -> REAL else -> NUMERIC ``` > [!NOTE] Boolean Values > Boolean values are stored as integers 0 (false) and 1 (true). SQLite recognizes "TRUE" and "FALSE" are treated equiv to literals 1 and 0. #### Autoincrementing Primary Keys #### Default Values If the default value of a column is `CURRENT_TIME`, `CURRENT_DATE` or `CURRENT_TIMESTAMP`, then the value used in the new row is a text representation of the current UTC date and/or time. ``` CURRENT_TIME -> "HH:MM:SS" CURRENT_DATE -> "YYYY-MM-DD" CURRENT_TIMESTAMP -> "YYYY-MM-DD HH:MM:SS" ```