Sql data types and constraints
Data Types
Here are the most common data types used in SQLite3:
- INTEGER: a whole number
- REAL: a decimal number
- TEXT: a string of characters
- BLOB: binary data
Constraints
Here are some common constraints that can be applied to columns:
- NOT NULL: disallows null values
- UNIQUE: ensures that all values in the column are unique
- PRIMARY KEY: uniquely identifies each row in the table
- FOREIGN KEY: creates a link between two tables