Chapter 20Enforcing Data Integrity and Relationships between Tables

When creating tables in a database, you often need to define rules regarding the values allowed in columns (fields). As mentioned in Chapter 19, constraints allow you to enforce integrity by creating rules for a table. The five types of constraints are listed below.

Table 20-1: Table constraints

Constraint Name

Usage

PRIMARY KEY

Identifies the column or set of columns whose values uniquely identify a row in a table.

FOREIGN KEY

Defines the relationship between tables and maintains data integrity when records are being added, changed, or deleted in a table.

UNIQUE

Ensures that no duplicate values are entered in a specific column or combination of columns that is not ...

Get Access 2007 Programming by Example with VBA, XML, and ASP 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.