SQL constraint / 约束
- Not Null
- Default
- Unique
- PK
- Foreign Key
- Check Constraint
Data Integrity
- Entity, nu duplicate rows
- Domain, enforce valid entries by restricting the type, format, range of value
- Referential Integrity, rows cannot be deleted which are used by other records
- User-defined Integrity
Nomalization
1NF
- pk,
- no repeating, if repeating, split to more than 1 tables
2NF
- meet 1NF
- no partial dependences
3NF
- meet 2nf
- all non-primary fields are dependent on pk
SQL Comparison Operatoes
= is like ==
SQL Logical Operators
- All
- And
- Any
- Between
- Exists
- in
- Like
- Not
- or
- is Null