一般数据采用的固定的静态数据类型,而SQLite采用的是动态数据类型,会根据存入值自动判断。SQLite具有以下五种数据类型

1.NULL :空值。
2.INTEGER :带符号的整型,具体取决有存入数字的范围大小。
3.REAL :浮点数字,存储为8-byte IEEE 浮点数。
4.TEXT :字符串文本。
5.BLOB :二进制对象
 
也支持一些其它的常用数据类型,在使用时会转换为 SQLLite 内置的数据类型:
smallint 16    位元的整数。
interger 32    位元的整数。
decimal(p,s) p 精确值和 s 大小的十进位整数,精确值p 是指全部有几个数(digits) 大小值,s 是指小数点後有几位数。如果没有特别指定,则系统会设为 p=5; s=0
float        32 位元的实数。
double 64 位元的实数。
char(n) n 长度的字串,n 不能超过 254
varchar(n) 长度不固定且其最大长度为 n 的字串,n 不能超过 4000
graphic(n) char(n) 一样,不过其单位是两个字元 double-bytes n 不能超过127 。这个形态是为了支援两个字元长度的字体,例如中文字。
vargraphic(n) 可变长度且其最大长度为 n 的双字元字串,n 不能超过 2000
date    包含了 年份、月份、日期。
time  包含了 小时、分钟、秒。
imestamp 包含了 年、月、日、时、分、秒、千分之一秒。
datetime 包含日期时间格式,必须写成'2010-08-05' 不能写为'2010-8-5' ,否则在读取时会产生错误!
 
1. SQLLite 数据库的操作语句( 基本sql 命令 )
 
建表:create table t_student(id INTEGER primary key autoincrement, name varchar(20));
   增加:insert into t_student (id,name) values(1,’happy’);
         如果主键是int 类型的,并且没有使用autoincrement 自动增长,默认也是自动增长的
         执行 insert into t_student (id,name) values(’good’); id 会自动增长
   查询:select id,name from t_student;
   更新:update t_student set name=’verygood’ where id=2;
   删除:delete from t_student where id=2;
   排序:select id,name from t_student order by id desc;   ( 根据id 降序排)
   分组:select id,name from t_student group by name;    ( 有待研究)
          分组后筛选:having
   分页:select id,name from t_student limit(0,2);-------------- 从第0 行开始,不包括0 行,取2 ( 取第1 2 )
         select id,name from t_student limit(2,2);--------------- ( 取第3 4 )
注意:SQLLite 数据库建议所有的表的主键列名应为_id android 中也建议采用,如果不采用,在使用SimpleCursorAdapter 适配器时会出错