1. 程式人生 > >SQLite3資料庫操作: 建庫,建…

SQLite3資料庫操作: 建庫,建…

//建立資料庫,資料庫檔案放在Sqlite.exe 的根目錄下

C:\>sqlite3.exe mydatabase.db

//資料庫建立成功後自動跳轉至:sqlite>

    1.建表
        sqlite> create table user(id integer,username text,password text);

    2.新增資料
        sqlite> insert into user values(1,'king','king');

    3.查詢資料
        sqlite> select * from user;

     4.更新資料
        sqlite> update user set username='kong',password='kong' where id=1;
     5.刪除資料

        sqlite> delete from user where username='kong';