From the course: Learning Relational Databases

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Apply integrity constraints

Apply integrity constraints

From the course: Learning Relational Databases

Start my 1-month free trial

Apply integrity constraints

- One of the most important things about having your data stored in a database is being able to trust that the data has been entered correctly. The database management system can protect you in a number of ways from getting invalidated into the database in the first place through a series of rules called "integrity constraints". Sometimes integrity constraints are implemented through a new related data table. For instance, when storing a two letter state abbreviation you might refer to a separate state lookup table to ensure that the entered value appears in the table of valid state abbreviations. Lookup tables will include all of the valid choices for a particular piece of data. A second approach to the same problem is to create what's called "a check constraint", or in Microsoft Access it's known as a validation rule. Here we can build the constraint right into the design of the table itself without needing any additional tables. The advantage to this approach is, well, one less…

Contents