SQLITE SQLITE learning the basics (c)

SQLITE data types

SQLite data type is used to specify a data type attribute of any object. Each column in SQLite, the data type of each variable and expression are related.

. 1) SQLite storage class
Note : Each value is stored in the database are SQLite have one storage class

  • NULL: value is a NULL value.
  • INTEGER: the value is a signed integer, stored value in accordance with the size of 1,2,3,4,6 or 8 bytes.
  • REAL: value is a floating point value, stored as 8-byte IEEE floating-point numbers.
  • TEXT: the value is a text string, using the database encoding (UTF-8, UTF-16BE or UTF-16LE) storage.
  • BLOB: a blob data value is fully stored in accordance with its input.

2) SQLite affinity (Affinity) type
SQLite supports the concept of type affinity column. Any column can still store any type of data, when the data is inserted, the data of this field will be given priority as a storage type of the affinity values. SQLite current version supports the following five types of kinship:
Here Insert Picture Description
SQLite affinity type (Affinity) and type name:
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
3) Boolean data type
SQLite does not have a separate Boolean storage class. Instead, the Boolean value is stored as an integer of 0 (false) and 1 (true).

4) Date and Time data type
SQLite not separate for storing a date and / or time-based storage, but SQLite able to store the date and time as TEXT, REAL or INTEGER value.
Here Insert Picture Description

Guess you like

Origin blog.csdn.net/cainiaoxiakexing/article/details/91874477