I. Constraints on tables
1. Unique constraints
1-field content (Multi-field content merge) Unique, cannot have duplicate rows
2-the same table can have multiple unique constraints
2. Check constraints
1-Ensure that the requirements are met before saving
2-Validation of the range of values for field data
3. Maintaining integrity between tables
3. FOREIGN KEY constraints
1-The primary key is associated to a field in another table, which is the foreign key
2-Requirement: The foreign key is added or modified, the data must exist in the primary key table; When the primary key field is modified or deleted, the data does not exist in the external key table.
Two. Rules for building tables
Conforms to three paradigms:
1. First paradigm: The meaning of field expression is single, non-split
2. Second paradigm: Avoid data redundancy, split redundant data into multiple tables, and correlate between tables
3. Third paradigm: avoiding transmission of dependence
4. Balance the paradigm and redundancy to achieve the best results for increased efficiency
Three. SQL statements
1. Classification
1-Data Definition language DDL
2-Data Control Language DCL
3-Data Management language DML
4-Data Query Language DQL
2. Operators
1-Arithmetic operator: + 、-、 *,/
2-Comparison operators: >,>=,<,<=,=,!=, <>
3-logical operators: and with, or or, not non-
4-string Operator: Join operation | |, enclosed in single quotation marks, representing the string
3. Features
1-third-generation languages
2-Case insensitive
Data storage--sqlite Database storage 2