
published 20 Oct 1995 : 01 Jan 1996 updated
We hope you didn't fall for this trick question. Unfortunately, almost every database system will! Both factors in our simple challenge are of numeric type with scale of 3 and one decimal precision. But their values are of different domains.
Codd first defined his relational theory of data in terms of "tuples" (rows) and "domains" (columns). The tuple holds a specific value for each attribute in a single occurrence of data. The domain holds all possible values for one individual attribute. While the concept of a row or tuple is simple to grasp, the domain is a little deeper than first glance might suggest, as witness our quiz above.
Relational theory says a domain defines all values which may be entered into it. Is "Blue" a valid value in a column of weights? Is 194.227 a valid city name? We can limit values by naming them specifically (e.g., "Male", "Female") or by specifying rules which will govern the set of allowed entries ("a positive prime number less than 1,000").
But domain content is not enough to assure integrity. We must also control domain behavior, as in the opening example. That is, a relational DBMS should automatically prohibit any operation inappropriate to the domain(s) of the factors in the operation. So we should not worry about multiplying colors or concatenating binary numbers. In fact almost every DBMS enforces these primitive behaviors through data types.
However our example demonstrates that there is more influencing a domain's definition than its simple data type. Relational theory demands that domain operations respect the complete domain definition, including rules of inclusion, thus prohibiting the nonsensical answer of "3,672.84 inch years". To date, the only mechanism to implement such extended domain definitions is through rules coded into the users' applications (whether in client code or dbms procedures). Even SQL 3 deals lightly with this topic.
Go to: Instruction Outline | Index/Glossary
Copyright © 1995 Applied Information Science International; 20 Oct 1995