首页 > 数据库技术 > 详细

SQLite学习笔记

时间:2018-09-30 13:29:19      阅读:121      评论:0      收藏:0      [点我收藏+]

Windows获取SQLite

 1.主页: www.sqlite.org

 2.下载 Precompiled Binaries For Windows

 3.设置系统环境PATH

 

使用

 打开cmd,输入sqlite3

 命令 .help 帮助

         .exit 退出程序

 

数据库管理

//创建数据库,
sqlite3 test.db
//创建一个表,此时才会创建数据库
create table test (id integer primary key, value text);
//向表中插入几行数据
insert into test (id ,value ) values(1,eenie);
insert into test (id ,value ) values(2,meenie);
insert into test (value) values (miny);
insert into test (value) values (mo);
//返回插入内容
.mode column
.headers on
select * from test;
//获得最后插入的自动增量值
select last_insert_rowid();
//添加一个索引和视图
create index test_idx on test (value);
create view schema as select *from sqlite_master;
//退出
.exit

 

SQLite学习笔记

原文:https://www.cnblogs.com/restpain/p/9728859.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!