World's most popular travel blog for travel bloggers.

Integrity Constraints

, , No Comments

Referential Integrity
Constraints on associations should be examined for referential integrity implications in the database models. Ask when referential integrity rules should be enforced. Immediately, or at a later time? When you are modeling object instances over time, you may need to introduce extra object classes to capture situations where attribute values can change over time. For instance, if you need to keep an audit trail of all changes to an order or invoice, you could add a date and time attribute to the order or invoice objects to allow for storage of a historical record of their instances. Each change to an instance would result in another instance of the object, stamped for data and time of instance creation.
Insert Rules
These rules determine the conditions under which a dependent class may be inserted and they deal with restrictions that the parent classes impose upon such insertions. The rules can be classified into six types.
Dependent : Permit insertion of child class instance only when the matching parent class instance already exists
Automatic : Always permit insertion of a child class instance. If the parent class instance does not exist, create one
Nullify : Always permit insertion of the child class instance.
Default : Always permit insertion of a child class in séance.
Customized : Allow child class instance insertion only if certain validity constraints are met.
No Effect : Always permit insertion of the child class instance. No matching parent class instances may or may not exist. No validity checking is performed.
Domain integrity
These integrity rules define constraints on valid values that attributes can assume. A domain is a set of valid values for a given attribute, a set of logical of conceptual values from which one or more attributes can draw their values. For example, India state codes might constitute the domain of attributes for employee state codes, customer state codes, and supplier state codes. Domain characteristics include such things as:
• Data type
• Data length
• Allowable value ranges
• Value uniqueness
• Whether a value can be null, or not.
Domain describes a valid set of values for an attribute, so that domain definitions can help you determine whether certain data manipulation operations make sense.

0 comments:

Post a Comment

Let us know your responses and feedback