Database integrity: Reliable + accurate = integrity
Database integrity: Entities: Ensure that each row has a data field: A column of data references: Guaranteed numbering customization: ensure your own rules
Primary key: Ensures that each row of Entity data can be differentiated without identical data
Constraint: Name format primary key set Primary key
UNIQUE constraint: Column values can only be unique nullable can be multiple unique names format unique NOT NULL
Non-empty constraint: NOT null (cannot be null)
Default constraint: "input constraint" Null is also assumed to be a value
Check constraint: Check (gender=1 or (or meaning here) gender=0)
FOREIGN KEY constraint: A constraint foreign key that links to an external table is a dependency on a primary key that is a new constraint imposed by a foreign key
Constraint established foreign Key name foreign key (the key to be connected in this table must be the same as the primary key attribute that needs to be connected, such as: int int) references the table name of the connection (the table's primary key name)
2016/5/8 Database 2