Database Reference
In-Depth Information
SUPPLIER
SupplierID SupplierName SupplierStatus SupplierCity ShipCode
PART
PartNo
PartName
PartColor PartWeight
SUPPLY
SupplierID
PartNo
Quantity
SHIP-METHOD
ShipCode
ShipDesc
UnitCost
Figure 15-5
Suppliers and parts database.
Domain Integrity Recall the DDL statements defining a relational schema. Each
attribute has an underlying domain; the attribute can take values only from a spe-
cific domain of values and can only be of a particular data type. When a transaction
inserts or updates a row in a particular table, the values of the attributes added or
changed must conform to the domain values of the attributes. If they do not, then
the transaction attempts to violate domain integrity rules. Violations of domain
integrity rules are more common than you might imagine, and they must be
addressed to preserve database integrity.
Figure 15-6 shows the DDL statements for defining the relational database
schema for the suppliers and parts database.
Note the following examples of domain integrity rules as indicated in the schema
definition. The transaction manager of the DBMS must detect any attempted
violation and reject the transaction with a message. In some cases, the system may
substitute default values and allow the transaction to proceed.
Data types. Each attribute must conform to the defined data type.
Null values. Null values are not allowed for the attribute SupplierName.
Allowable values. Only certain values are allowed for the attribute SupplierStatus.
Range values. Values for PartWeight must fall within the given range.
Missing values. Substitute a given color if value of PartColor is missing.
Referential Integrity Refer to Figure 15-6 and note the ON DELETE clauses.
These specify conditions for enforcing referential integrity constraints. Also, note
the NOT NULL conditions for foreign keys. These specify actions to preserve
Search WWH ::




Custom Search