SQLITE3 常用操作
2010-09-11 16:14
239 查看
<!--
@page { margin: 0.79in }
PRE.western { font-family: "Liberation Serif" }
PRE.cjk { font-family: "Liberation Serif" }
P { margin-bottom: 0.08in }
-->
@page { margin: 0.79in }
PRE.western { font-family: "Liberation Serif" }
PRE.cjk { font-family: "Liberation Serif" }
P { margin-bottom: 0.08in }
-->
SQLITE3 常用操作 收藏 1.建立数据库 在sqlite安装的目录/usr/bin下,(其实在任何目录都可以输入下面语句) sqlite3 sensordata.db 该语句新建一个名为sensordata的 数据库,并进入该数据库,在该目录下生成sensordata.db文件,即为数据库文件 2.建立表 create table sensortable1(one varchar(10), two smallint); CREATE TABLE sensortable1(ID smallint primary key,Source smallint,Dest smallint,Accel_x smallint,Accel_y smallint,Accel_z smallint,Temperature smallint,Humidity smallint,BrdLight smallint,InfraLight smallint); CREATE TABLE sensortable1(ID INTEGER PRIMARY KEY AUTOINCREMENT,Source smallint,Dest smallint,Accel_x smallint,Accel_y smallint,Accel_z smallint,Temperature smallint,Humidity smallint,BrdLight smallint,InfraLight smallint); 3.插入数据 insert into sensortable1 values('hello!',10); insert into sensortable1 values(null,0,0,2048,2048,2048,37500,34000,100,100); insert into sensortable1 values(1,0,0,2048,2048,2048,37500,34000,100,100); 4.显示表的各列名称 .header on 5.显示数据 select * from sensortable1; select * from sensortable1 where ID >5; 6.显示当前数据库中的表 .tables 7.删除数据表中的数据 删除所有 delete from sensortable1; 条件删除 delete from sensortable1 where name <20; 8.删除数据表 drop table sensortable1; 9.退出sqlite3 .exit 10.强制退出 control+D 更多详细操作参考http://www.sqlite.org/sqlite.html 11.对齐显示 .mode column select * from sensortable1; 12.显示创建表的语句 .schema Show the CREATE statements
相关文章推荐
- sqlite3 常用操作
- sqlite3常用命令以及django如何操作sqlite3数据库
- sqlite3 常用操作
- 【SQLite】常用操作SQL及压缩SQLite的实例代码
- sqlite3 常用操作
- [sqlite3]_[初级]_[常用操作]
- SQLITE3数据库的常用操作
- sqlite命令行常用操作
- sqlite3常用操作
- sqlite3 常用操作
- [sqlite] 判断表、视图是否存在及常用C#操作语句
- 我的Android进阶之旅------>温习Sqlite3的常用操作
- sqlite3-操作数据库常用命令
- sqlite3 常用操作
- SQLite中的常用操作(总结)
- sqlite3常用操作命令 和mysql的区别及优缺点
- sqlite3 常用操作
- SQL:sqlite3数据库常用操作
- sqlite3常用操作命令 和mysql的区别及优缺点
- sqlite常用操作