Relational Terminology

Figure 1-3 shows a relation with the formal names of the basic components marked. Those of you who know something about relational design will recognize that the relation is not in normal form. That's okay; it still qualifies as a relation because it's arranged in row and column format and its values are scalar.

click to view at full size.

Figure 1-3. The components of a relation.

The entire structure is, as we've said, a relation. Each row of data is a tuple (rhymes with "couple"). Actually, each row is an n-tuple, but the "n-" is usually dropped. The number of tuples in a relation determines its cardinality. In this case, the relation has a cardinality of 11. Each column in the tuple is called an attribute. The number of attributes in a relation determines its degree. The example relation has a degree of 3.

The relation is divided into two sections, the heading and the body. The tuples make up the body, while the heading is composed of, well, the heading. Note that the label for each attribute is composed of two terms separated by a colon—for example, UnitPrice:Currency. The first part of the label is the name of the attribute, while the second part is its domain. The domain of an attribute is the "kind" of data it represents—in this case, currency. A domain is not the same as a data type. We'll be discussing this issue in detail in the next section. The specification of domain is often dropped from the heading.

The body of the relation consists of an unordered set of zero or more tuples. There are some important concepts here. First, the relation is unordered. Record numbers do not apply to relations. Relations have no intrinsic order. Second, a relation with no tuples (an empty relation) still qualifies as a relation. Third, a relation is a set. The items in a set are, by definition, uniquely identifiable. Therefore, for a table to qualify as a relation, each record must be uniquely identifiable and the table must contain no duplicate records.

If you've read the Access or SQL Server documentation, you might be wondering why you've never seen any of these words before. They're the formal terminology used in the technical literature, not the terms used by Microsoft. I've included them just so you won't be embarrassed at cocktail parties (at least not about n-tuples of third degree, anyway). Remember that relations are purely conceptual; once instantiated in the database, they become recordsets in Microsoft Jet and result sets in SQL Server, while for both Microsoft Jet and SQL Server an attribute becomes a field and a tuple becomes a record. The correspondences are pretty much one-to-one, but remember that relations are conceptual and recordsets and result sets are physical.



Designing Relational Database Systems
Designing Relational Database Systems (Dv-Mps Designing)
ISBN: 073560634X
EAN: 2147483647
Year: 1999
Pages: 124

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net