First, some characteristics of sqlite3:
1, light weight, do not need to install
Sqlite3 does not need to be configured, does not require installation, and does not require an administrator. The most cattle is that it does not have a server, is only an EXE or DLL;
2, the database in the form of files stored on the disk, you can freely copy the use;
3. Because Sqlite3 does not have a server listening port, it cannot connect to the database remotely via IP and port like MySQL. If you want to access the database remotely, only through database file sharing
Second, the database operation:
The first step is to go to the project root and then the command line.
#进入db文件夹下面的数据库development. Sqlite3sqlite3 db/development.sqlite3# View the table for this database.Table#创建表格Create TableUsers (IDintegerPrimayKey, usernametext); #插入数据Insert intoUsers (username)Values(' Zhangsan'); #查看表格中的数据Select * fromusers; #查看表的结构:Select * fromSqlite_masterwhereType="Table"; #默认情况下, the header in the red box does not appear and needs to be set before the command is:. Header on#如果只想查看具体一张表的表结构, such as viewing the Emperors table, the command is:Select * fromSqlite_masterwhereType="Table" andName="Emperors"; #另外, you can do this: SQLite>.SchemaEmperorsCREATE TABLEEmperors (IDinteger Primary KeyAutoIncrement, Nametext, Dynastytext, Start_yeartext);
Reference: http://www.cnblogs.com/zs-note/p/3921865.html
Sqlite3 Database Operations