Chapter II using the SQLite database

Source: Internet
Author: User
Tags arithmetic operators sqlite database

SQLite database

Features: Lightweight, no installation required. A database corresponds to a file.

-->sqlite3 d:/mydb.db (Create a new mydb.db file under D, open the file if it exists)

-->.databases into the database.

-->.schema Querying all table structures

-->.schema City Query The table structure in the city table//schema Overview n

-->.tables list all the table names

-->.help Viewing command Help

SELECT statement query:

Select field name from table name where filter condition;

Distinct field name to redo the current field

After where the arithmetic operators such as +,-,% can be executed;

After where you can perform comparison operators such as >,<,<>;

Where it can be performed with or non-operational such as And,or;

Limit 5 Query the first 5 data

Limit 5,3 from the sixth row, check 3 data (that is, 6,7,8 line).

Limit 3 offset 5 query from line sixth, check 3 data (that is, 6,7,8 line).

The Order By field name Asc/desc is in the current word Sheng/reverse order.

Like "_abc%"; Start with any single character, the middle is ABC, and then the content is unlimited.

In (A,B,C,D); Satisfies any one of the data in the in.

Between A and B are closed intervals from A to B.

Note: column names, table names are case-insensitive, and the value of the query field is case-sensitive.

such as: where name = "abc"; WHERE name = "ABC";

As an example above, the field name and name are case-insensitive. But ABC and ABC, which are filter conditions, are case-sensitive.

Chapter II using the SQLite database

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.