c语言sqlite3写数据类型,SQLite 数据类型

SQLite 数据类型

Android,sqlite,数据类型,

Android使用的是SQLite数据库,SQLite对数据类型不是很重视,或者说很灵活,你可以定义成数字的类型,但是可以把它当成字符来使用。不过为了便于代码阅读,还是写上相符合的类型比较好。

类型主要有5种,NULL , INTEGER , REAL , TEXT , BLOB

Most SQL database engines (every SQL database engine other than SQLite, as far as we know) uses static, rigid typing. With static typing, the datatype of a value is determined by its container - the particular column in which the value is stored.

SQLite uses a more general dynamic type system. In SQLite, the datatype of a value is associated with the value itself, not with its container. The dynamic type system of SQLite is backwards compatible with the more common static type systems of other database engines in the sense that SQL statement that work on statically typed databases should work the same way in SQLite. However, the dynamic typing in SQLite allows it to do things which are not possible in traditional rigidly typed databases.

Each value stored in an SQLite database (or manipulated by the database engine) has one of the following storage classes:

NULL. The value is a NULL value.//这个很特殊,估计很少用到。

INTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.//当成整形

REAL. The value is a floating point value, stored as an 8-byte IEEE floating point number.//当成浮点

TEXT. The value is a text string, stored using the database encoding (UTF-8, UTF-16BE or UTF-16LE).//字符串

BLOB. The value is a blob of data, stored exactly as it was input.//二进制

相关文章

- EOF -

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处,尊重他人劳动。

转载请注明:文章转载自 Binkery 技术博客 [https://binkery.com]

本文标题: SQLite 数据类型

本文地址:https://binkery.com/archives/186.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值