"SQLite" syntax

Source: Internet
Author: User
Tags sqlite

"SQLite" syntax

One. Create a database

1. Just create a database, just create a file, and when you do, point the connection string to the file

2. Connection string: Data Source = FilePath; Can't encrypt, so no password.

Two. Create a table

1. Syntax: CREATE TABLE TableName (str text,pic blob,int INTEGER)

2. Field type: You can ignore the type, you set all types to TEXT is not a problem, but for easy to use and reading, it is recommended to set the corresponding type (picture, binary BLOB), or read the data when the conversion may be problematic

Three. Common syntax (basically consistent with SQL SERVER and improved with some common statements)

1. SELECT as

2. DELETE as

3. Insert Update:sqlite with REPLACE, if there is a unique constraint in the field, storage, the unique field is the same UPDATE, different insert, this is very convenient

4. Group: SQLite has the limit OFFSET keyword, limit gets the number, OFFSET start index, this is much more useful than SQL SERVER

5. System functions are basically consistent with SQL SERVER, such as Max,disdinct,order By,inner JOIN

Four. Summarize

1. As an open source free database, SQLite is very powerful

2. Use, some small applications, local data inventory offline data, but can not be encrypted, so private data can not be saved

"SQLite" syntax

Related Article

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.