Tuples / Domains

Tuples / Domains

Tuples

The rows of a relation, other than the header row containing the attribute names, are called tuples. A tuple has one component for each attribute of the relation. For example, the first of the three tuples in the following figure, has the four components Star Wars, 1977, 124, and color for attributes title, year, length, and filmType, respectively. When we wish to write a tuple in isolation, not as part of a relation, we generally use commas to separate components, and we use parentheses to surround the tuple. For instance,

(Star Wars, 1977, 124, color)

is the first tuple of the following figure. Notice that when a tuple appears in isolation, the attributes do not appear, so some-indication of the relation to which the tuple belongs must be given. We shall always use the order in which the attributes were listed in the relation schema.

Domains

The relational model needs that each component of each tuple be atomic; that is, it must be of some elementary type such as integer or string. It is not allowed for a value to be a record structure, set, list, array, or any other type that can reasonably have its values broken into smaller components.

It is further assumed that connected with each attribute of a relation is a domain, that is, a specific elementary type. The components of any tuple of the relation must have, in each component, a value that belongs to the domain of the corresponding column. For instance, tuples of the Movies relation of the following figure must have a first component that is a string, second and third components that are integers, and a fourth component whose value is one of the constants color and blackAndWhite. Domains are part of a relation's schema, although we shall not build up a notation for specifying domains until we reach "Simple Table Declarations".

The relation Movies



Tags