Defining Integrity Constraints

From InterBase
Jump to: navigation, search

Go Up to Developing a Set of Rules (Designing Databases)

Integrity constraints are rules that govern column-to-table and table-to-table relationships, and validate data entries. They span all transactions that access the database and are maintained automatically by the system. Integrity constraints can be applied to an entire table or to an individual column. A PRIMARY KEY or UNIQUE constraint guarantees that no two values in a column or set of columns are the same.

Data values that uniquely identify rows (a primary key) in one table can also appear in other tables. A foreign key is a column or set of columns in one table that contain values that match a primary key in another table. The ON UPDATE and ON DELETE referential constraints allow you to specify what happens to the referencing foreign key when the primary key changes or is deleted.

For more information on using PRIMARY KEY and FOREIGN KEY constraints, see Working with Tables. For more information on the reasons for using foreign keys, see Establishing Relationships between Objects.

Advance To: