Free advertising

Free AdvertisingCoupon CodeDell CouponGap CouponTarget Coupon
Oracle: Data Integrity

Monday, October 6, 2008

Data Integrity

Integrity refers to the wholeness and soundness of the database. Some of the most important integrities are discussed below.

Domain Constraints: A domain is as set of values that are permitted to appear in one or more columns. Once a domain is specified and a column is associated with the domain, the column can take only those values permitted by the domain.

Primary Key and Entity Integrity: Primary key is a column or set of columns in a table which uniquely identifies a row in a table. No two rows of the table can have the same values for the primary key. Entity integrity is maintained by ensuring that none of the columns that make up the primary key can take “Null” (unknown) values.

Foreign keys and Referential Integrity: Consider two tables viz: Employee and Dept. Let dept no be a field in Dept table. If in Employee table, dept no field is taken as foreign key from Dept table, then the Employee table cannot contain a value for the deptno, which does not exist in the table Dept.

The referential integrity rule specifies that if a foreign key in table A refers to the primary key in table B, then every value of the foreign key in table A must be null or must be available in table B.

Delete Restrict referential integrity: This means that no foreign key can be deleted if there are some foreign key values dependent on it.

Delete Cascade referential integrity: This means that if the primary key value is deleted then all foreign key values dependent on it will be deleted.

Update Cascade referential integrity: This means that if the primary key value is updated then all foreign key values dependent on it will be updated to the new value of primary key.

Column Constraint: These are the constraints, which specify restrictions on the values a column can take. These restrictions may be defined with or without other values in the same row.

Free advertising

Free AdvertisingCoupon CodeDell CouponGap CouponTarget Coupon