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