Copyright: Xiao Bai qq:99565687 "Actually this QQ is Me"
Disclaimer: Sqlite3 database is encoded with utf-8, so try not to use the database in Chinese.
Delete column and column data "method":
1. Create a new temporary table (t)-and set the field name inside the T table to be the same as the table you want to delete.
2. The table where the column is to be deleted all data is transferred to the staging table.
3. Delete the table for which you want to delete the column, and then name the temporary table (t) the name of the table where you want to delete the column.
Delete a single data "method"
1.update table name set field name =null where condition
2.null, is empty meaning, as long as the individual data is updated to NULL, it proves that there is no data, then the equivalent is deleted!
Select Algorithm "Method"
1. Calculate the value on the same line: The precondition is the numeric type.
The direct use of the calculation symbol (+-*/%) can be.
2. Temporarily change the name of the column.
For example: Select field name as temporary field name from table name;
3. Query the data for the specified row.
Select field name from table name where condition;
Some examples of conditions behind 4.where
Take a value greater than 90: where value >90
--that can be judged. (Logical judgment can be!) )
For example:> < <= >= = (<> not equal)
Field name between value 1 and value 2 (range of values) The judging words--including the value 1 and the numeric value 2! are qualified.
Field name like ' condition ' (typically: 9% or Li%)
_--a single arbitrary character.
%--is the character after which the value continues to be displayed.
Determine if null: Field name where is null--there is empty data in the row where the field name is viewed, the line is displayed.
Field name where not null--the row that views the field name is not empty data.
"And &" multiple conditions set up at the same time
"or |" multiple conditions are set
"Not!" is not true, for example: where NOT (salary>100)-meaning that the salary is not greater than 100 of the data display output;
5. Permutation statement: ORDER BY Field name ASC (small to large) Order by field name Desc (from largest to smallest)
6. Aggregate function: "COUNT (*) output record Rows"--count (field name) outputs the number of record rows that the column is not NULL.
sum (field name numeric type)--Add column data
Max (field name numeric type)--output column highest data
Min (field name numeric type)--Output column minimum data
AVG (field name numeric type)--output column average data
PS: Many people say that they want to get started with SQLite quickly, then I will provide some SQL methods/and statements, I hope you can learn in one day!
Then this chapter version will be updated to 3.0, so please look forward to it.
SQLite Method-2.0