- Shopping Bag ( 0 items )
Other sellers (Paperback)
-
All (32) from $1.99
-
New (10) from $46.65
-
Used (22) from $1.99
More About This Textbook
Overview
This book provides a practical and proven approach to designing relational databases. It contains two complementary design methodologies: logical data modeling and relational database design. The design methodologies are independent of product-specific implementations and have been applied to numerous relational product environments.
0201114348B04062001
Product Details
Related Subjects
Read an Excerpt
Chapter 12: Translate the Logical Data Integrity
Chapter 12 completes the translation process. It examines implementation options for enforcing business rules about
As part of logical data modeling, you identified two types of business rules about entities. These rules define the primary and alternate keys for an entity.
To review, a primary key is an attribute or minimal set of attributes that uniquely identifies an occurrence of a given entity. The primary key must exist for all occurrences of the entity. That is, it must never contain null values. Enforcing the properties of primary key is important in your relational implementation if you are to achieve a faithful and complete translation of your logical data model.
RULE RDD4.1
Enforce logical properties (uniqueness, minimality, and disallowance of nulls) of the entity's primary key through the relational implementation.
Different relational database products provide various mechanisms for enforcing these logical properties. We describe options that may be available, in order of preference and with associated advantages and disadvantages.
OPTION 1 FOR ENFORCING PRIMARY KEY PROPERTIES: DATA DEFINITION LANGUAGE (DDL)
As an example of option 1, the following syntax represents a proposed extension- to the ANSI SQL standard to support primary key specification:
By definition, a primary key must be unique and nonnull. Moreover, since it is a minimal set of identifying attributes, if it is composite, each component must be nonunique. (That is, if one component is unique, then the other components are not necessary to guarantee uniqueness. Thus, The combination of components is not a minimal set of identifying attributes.) The PRIMARY KEY syntax ideally should activate automatic enforcement of these properties by the DBMS. (In fact, the proposed ANSI SQL PRIMARY KEY clause implies only uniqueness, not existence and not minimality.)
Advantages of a DDL PRIMARY KEY specification include:
On the other hand, you may later (in Chapters 13 and 14) define a primary index or other primary access mechanism (such as clustering or hashing). The primary or favored access mechanism represents the most efficient way of accessing the table for most requests. Thus, it typically reflects access requirements rather than data integrity rules. Sometimes, the primary access mechanism is built around the primary key, but only when access by primary key is frequent or important. If access by primary key is infrequent or unimportant, the primary access mechanism is built around other columns (e.g., foreign keys, nonkeys, or partial primary keys).
OPTION 2 FOR ENFORCING PRIMARY KEY PROPERTIES: DOMAIN DEFINITION TECHNIQUES
You can enforce at least some primary key properties (uniqueness, disallowance of nulls) through a product's domain capabilities. Options and examples for enforcing domains are discussed as part of Step RDD6. For primary keys, you will typically use DDL to specify nonnull, and either DDL or a unique index to specify uniqueness. Automated enforcement of nonuniqueness of primary key components (in the case of a composite primary key) may not be possible (see discussion of enforcing nonuniqueness under Step RDD6). Therefore, be sure the user has defined a minimal primary key in the first place.
Advantages of using domain techniques to enforce primary keys are the same as those identified for option 1. Disadvantages include the following:
Table of Contents
Introduction.
Why a Handbook of Relational Database Design?
Introduction to Logical Data Modeling.
Relational Concepts and SQL.
Introduction to Relational Database Design.
Build Skeletal User Views.
Add Keys to User Views.
Add Detail to User Views.
Validate User Views through Normalization.
Determine Additional Attribute Business Rules.
Integrate User Views.
Translate the Logical Data Structure.
Translate the Logical Data Integrity.
Tune by Establishing Storage-Related Access Mechanisms.
Tune by Adding Indexes.
Tune by Introducing Controlled Data Redundancy.
Tune by Redefining the Relational Database Structure.
Special Design Challenges.
Appendix.
Bibliography.
Index of Design Rules.
Index.