Home > database >  Define the data integrity constraints
Define the data integrity constraints

Time:09-22

Today for the data table to add a primary key constraint when out of the two problems,
The first one is not, look at the uniqueness of the primary key constraint in the table. That is the primary key constraint in a table can have only one, then I was defined as a student choose many electives and a course can be on the definition of different students didn't notice that they do not meet the uniqueness and cause behind the definition of tables out of the question, and one of the students choose a course of achievement is the only, so the composite column can set the primary key,
Another problem is the candidate key constraints, a table only allowed to have a primary key constraint, but it is possible to define more than one candidate key, create a candidate key constraints, the system will default to return for the index, it didn't pay attention to see, previously defined in the specified column to use UNIQUE clause, so as to set up as the only index,
Well, about the custom data integrity constraint of these two problems, small white road details are always done so so, wish you a great god can give me some advice, thank you!
  • Related