SQLite資料庫簡單使用

2021-07-24 21:34:45 字數 650 閱讀 5796

二、建立資料庫

sqlite3 student.db          //建立名為student的資料庫

sqlite3命令,引數就是資料庫的名稱,如果該資料庫已存在,則使用,如果不存在,則新建乙個

如圖:三、建立表

create table person (id integer primary key autoincrement, name varchar(20), age smallint);     //  建立了乙個表

.table //檢視已有的表

.schema person //檢視表的結構

四、運算元據

insert into person values (null, 'john', 30); 

select * from person

參照sql語句

Sqlite 資料庫 FMDB 簡單使用

1 通過sqlite建立資料庫。首先匯入框架 建立資料庫的路徑 nsstring path nssearchpathfordirectoriesindomains nsdocumentdirectory nsuserdomainmask yes lastobject data.sqlite 第乙個引...

SQLite記憶體資料庫簡單使用範例

include include include include sqlite3.h pragma comment lib,sqlite3.lib include include include codingconv.h int main int argc,char argv sql select f...

SQLite 簡單的資料庫

1.建立資料庫和表 引數1.資料儲存的檔案位置 引數2.檔案建立工廠類,這裡不需要,寫為空 db sqlitedatabase.openorcreatedatabase data data com.coderqi.android2 lesson 04 database database.db nul...