Integrity constraints
Data stored in the database must adhere to certain business rules. An integrity constraint defines a business rule for a table column. When the integrity constraint is enabled, Oracle will enforce the business rule. Integrity constraints are stored as part of table definition within the database.
The following are the integrity constraints:
NOT NULL:
TheNOT NULL
constraint enforces a column to not accept null values.CHECK:
TheCHECK
constraint is used to limit the values that are accepted by a column.UNIQUE:
TheUNIQUE
constraint is used to make sure that no duplicate values are entered in the column.PRIMARY KEY:
ThePRIMARY KEY
constraint is used to uniquely identify a row in a table.PRIMARY KEY
can be thought of as a combination of theUNIQUE
key andNOT NULL
constraints. Furthermore, a table can have only one primary key.FOREIGN KEY:
A foreign key column is used to establish link between two tables. TheFOREIGN KEY
constraint on a column ensures that the...