Question of the Day Twenty-Three
Let us continue our question of the day series with day twenty-three.
What is a constraint?
A constraint is simply a rule associated with a column in a table that any data entered must follow. Some examples are the unique constraint which ensures that no two records possess the same value for the column in question. Another commonly used constraint is the primary key constraint which provides a unique identifier for each row in a table. It is similar to the unique constraint but the key difference is that the unique constraint just means that ONE column is unique whereas a primary key can include up to a combination of 16 columns to make it unique. There is also the NOT NULL constraint which essentially means that the column cannot be left blank.
Enjoy!
Posted on August 25, 2012, in SQL Schoolhouse and tagged SQL Learning. Bookmark the permalink. Leave a comment.
Leave a comment
Comments 0