1. 程式人生 > >SQLite學習筆記

SQLite學習筆記

table weight 創建 column windows wid div sqlite 學習筆記

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學習筆記