SQLite数据库是目前非常好用的数据库软件,代替MySql。已经捆绑到了PHP5.0上,使用就像ASP和ACCESS结合一样方便,提供SQLite.exe下载,同时支持32/64位操作系统。有需要的朋友们千万别错过,欢迎大家到七达网下载体验使用!
官方介绍
SQLite是一款轻型的数据库,它的设计目标是嵌入式的,而且目前已经在很多嵌入式产品中使用了它,它占用资源非常的低,在嵌入式设备中,可能只需要几百K的内存就够了。它能够支持Windows/Linux/Unix等等主流的操作系统,同时能够跟很多程序语言相结合,比如Tcl、PHP、Java等,还有ODBC接口,同样比起Mysql、PostgreSQL这两款开源世界著名的数据库管理系统来讲,它的处理速度比他们都快。
常用语句
删除表: drop table 表名;
插入数据: insert into 表名 values(, , ,) ;
创建索引: create [unique] index 索引名on 表名(col….);
删除索引: drop index 索引名(索引是不可更改的,想更改必须删除重新建)
删除数据: delete from 表名;
更新数据: update 表名 set 字段=’修改后的内容’ where 条件;
增加一个列: Alter table 表名 add column 字段 数据类型;
选择查询: select 字段(以”,”隔开) from 表名 where 条件;
日期和时间: Select datetime('now')
日期: select date('now');
时间: select time('now');
总数:select count(*) from table1;
求和:select sum(field1) from table1;
平均:select avg(field1) from table1;
最大:select max(field1) from table1;
最小:select min(field1) from table1;
排序:select 字段 from table1 order by 字段(desc或asc) ;(降序或升序)
分组:select 字段 from table1 group by 字段,字段… ;
限制输出:select 字段 from table1 limit x offset y;
= select 字段 from table1 limit y , x;
(备注:跳过y行,取x行数据)
∨ 展开