SQLite 是一個的關聯式資料庫管理系統,它包含在一個相
對小的C庫中。它是 D.RichardHipp 建立的公有領域項目。
不像常見的客戶端/伺服器結構範例,SQLite引擎不是個程式與
之通訊的獨立行程,而是連線到程式中成為它的一個主要部分。
所以主要的通訊協議是在程式語言內的直接API呼叫。整個資料
庫定義、表、索引和資料本身)都在host主機上儲存在一個單
一的檔案中。

Cross-platfor 跨平台 :
支援應用系統 Unix (Linux, Mac OS-X, Android, iOS) and
Windows (Win32, WinCE, WinRT)並輕易移植其他系統


官方網站    SQLite shell     Download   


語法 :  


a . 運行dos模式 , 打開資料庫 , 如無此檔 , 則自動新增資料庫 abcd.db

     > sqlite3  abcd.db ;

 b. 建立名為 person的table 表 ,內有欄位  no , name ,age 三個

     sqlite3 > create table person(no,name,age) ; 

 c. 使用 .schema  person 觀看 table 的內部欄位結構

      sqlite3 >.schema  person

 

   201200161

 

  d.  新增表欄位 

       sqlite3 > insert into  person values('001','john','20');

       sqlite3 >insert into  person values('001','mary','18');

    e.查看新增結果 

       select  * from person;

 

   201200162         

 

F   .  修改欄位資料

      sqlite3 > update  person  set  no='002'  where name='mary';

   

G   .查看新增結果

       select  * from person;

 

    201200163      

h   .  刪除表格欄位資料

      sqlite3 > delete from person where name='mary' ;

i   .查看新增結果

       select  * from person;

 

    201200164  

arrow
arrow
    文章標籤
    sqlite sqlite shell
    全站熱搜

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