O'Reilly logo

SQL Fundamentals, Third Edition by John J. Patrick

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Data Integrity

This chapter discusses the ways data can be validated before it is entered into the database. Validation is particularly important when many people are entering data and sharing the same database. Validation also ensures that the data meets a certain level of consistency.

In a relational database, referential integrity is one of the main techniques of data validation. It protects columns that contain codes. For example, a column for gender can only contain the codes M and F. Referential integrity can enforce that rule.

A check constraint is another type of validation. It can check that some statement is true; for example, “Price is less than $100.00.” There is always validation on the primary key of a table to preserve ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required