close

SQlite 簡單介紹


介紹一下SQlite,
這套軟體就如同它的名字,是個lite 版本的sql :)
官方網站http://www.sqlite.org/

維基:SQlite
裡頭有介紹目前的支援的語言以及相關的應用套件。
像是:
以下列一下常用的指令集:

$ sqlite3 xxxx.db
打開某db

sqlite>

創造系
sqlite> create table tbl1(one varchar(10), two smallint);
sqlite> insert into tbl1 values('hello!',10);
sqlite> insert into tbl1 values('goodbye', 20);
sqlite> select * from tbl1;


或是

sqlite> CREATE TABLE tbl2 (
...> f1 varchar(30) primary key,
...> f2 text,
...> f3 real
...> );


觀察系
.databases
List names and files of attached databases

.schema ?TABLE?
Show the CREATE statements

.indices TABLE
Show names of all indices on TABLE

輸入/輸出

.dump ?TABLE? ...
Dump the database in an SQL text format

.import FILE TABLE
Import data from FILE into TABLE

.load FILE ?ENTRY?
Load an extension library

.read FILENAME
Execute SQL in FILENAME

脫離戰場

.quit |
.exit
Exit this program



簡單介紹到此,有問題可以先看sqlite faq

arrow
arrow
    全站熱搜

    tttt 發表在 痞客邦 留言(0) 人氣()