I. Features
1. Storage of data with a certain structure
2. File type. db
Two. SQLite database
1. Features
1-Lightweight relational database
2-Supports multiple programming languages
3-Suitable for use on mobile devices
4-Small installation files
5-Supports multiple operating systems
6-Fast running speed (low data volume)
7-The database itself is a single file
2. Data type
1-integers: INT, integer;
2-floating point: float, DOUBLE;
3-string literal
①char, fixed-length string;
②warchar, variable-length string;
③text, large text;
4-Time: Date, DateTime;
5-File: BLOB, infrequently used, affects query efficiency.
3. Table
N-Table name
2-field
① field name, with English letters and numbers, underline combination;
② Data types
③ data length: Floating-point number, total length or length after decimal point;
④ Default Value
3-Constraints
① non-null constraint: The field contents cannot be null;
② PRIMARY KEY constraints
1> Features
⑴ field content is not empty
⑵ primary key field content (Multi-field content merge) Unique, cannot have duplicate rows
⑶ A table can have only one primary key, but may have more than one primary key field
⑷ commonly used for data retrieval positioning and sorting
2> selection Form
⑴ Unique code information for table data
⑵_id
? auto-Grow field or sequence (self-growing number)
? data type is integral type
? The default is automatically incremented from 1, plus 1 for each fetch
⑶ a string of letters and numbers that uniquely identifies the guid:32 bit globally.
The process of the table:
Data storage--sqlite Database storage