First, inserting insert
1. Effect of primary key on data insertion
The primary key must be unique in the same table if the primary key specified when the data is inserted is already in the table
Duplication of data will result in an exception that violates the PRIMARY KEY constraint.
2. Effect of foreign key on data insertion
A foreign key is a constraint that points to an existing data in another table, so the foreign key value must be present in the target table. If the plug
Non-existent data in the target table will result in a violation of the FOREIGN KEY constraint exception.
Second, update updates:
1. The effect of non-null constraints on data update
As the expression "non-null constraint" means, if a non-null constraint is added to a field, we cannot
The values in the field are updated to NULL.
2. Effect of primary key on data update
The primary key must be unique in the same table if the primary key specified in the data update is already in the table
Duplication of data will result in an exception that violates the PRIMARY KEY constraint.
3. Influence of foreign key on data update
A foreign key is a constraint that points to an existing data in another table, so the foreign key value must be present in the target table. If more
The new data does not exist in the target table, which results in a violation of the FOREIGN KEY constraint exception.
Third, search
1, COUNT (*) and count (fields) are not the same
If a field is null,count the column does not count empty fields in it
Some details about the SQL statement