Introducing Constraints

A constraint is an object in a relational database that places rules on data inserted into a column of a table. There are several different types of constraints in SQL. The types of constraints and examples of the use of these constraints to maintain a high level of data integrity in your database is covered today. First, you must understand data integrity and the concepts behind using constraints.

Data Integrity

Constraints are used to ensure accuracy and consistency of data in a relational database. Data integrity is this assurance of accurate and consistent data in the database. Data integrity is handled in a relational database through the use of constraints on tables. Any time humans are entering data into a database ...

Get Sams Teach Yourself SQL in 21 Days, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.