Tuesday, January 10, 2012

Sql, what does creating a constraint mean?

A constraint is some sort of rule that data in a table must conform to. The one you specify is one of the most common - defining the primary key for a table (in fact, some DBMS require that every table have a primary key). It basically states that the combination of s# and c# must be unique for every row of the table (and as a consequence, yes, this implies that neither of those columns can be defined as nullable, since a null column cannot guarantee uniqueness.)

No comments:

Post a Comment