Sqlite3 Database Operations

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.