To avoid the problems you saw in the last Thinking Hat, database engines support the following kinds of constraints. Most of these are enforced at the database level (not by Entity Framework).
Most database engines require that primary keys be unique, but you might also need to specify this constraint for other fields, particularly if your candidate key is not the primary key.
Referential Integrity Constraint
When two tables are related, you must ensure that all the values in the child table are present in ...