Informatics Practices · Ch 6 — Database Concepts
Three Important Properties of a Relation
Three Important Properties of a Relation
A relation looks like an ordinary table, but it is not merely a table — the relational data model binds it with rules that a data file or a simple table never has to obey. Three properties capture those rules: one governs the attributes (columns), one governs the tuples (rows), and one governs the data values a relation may hold at any moment. Together they are exactly what makes a relation different from a data file or a plain table.
Property 1 — rules on the attributes
- Each attribute in a relation has a unique name. No two columns of the same relation may share a name; every attribute is unambiguously identifiable.
- The sequence of attributes is immaterial. Whether GName comes before or after GPhone changes nothing about the relation — columns carry meaning by name, not by position.
Property 2 — rules on the tuples
- Each tuple in a relation is distinct. No two rows may have identical data values for all the attributes. In the ATTENDANCE relation, for instance, no two tuples can agree on every attribute — every tuple must be uniquely identifiable by its contents.
- The sequence of tuples is immaterial. Even though a relation is displayed in tabular form, its tuples are not considered ordered. Shuffling the rows produces the same relation.
Property 3 — rules on the state of the relation
These rules constrain the actual data values sitting in the relation:
- All values in an attribute come from the same domain — that is, the same data type. A column of dates holds only dates; a column of numbers holds only numbers.
- Every value must be atomic: it cannot be divided further into meaningful subparts. The GPhone attribute of the GUARDIAN relation holds a ten-digit number, and that number is treated as indivisible.
- No attribute may hold many values in one tuple. A guardian cannot record multiple contact numbers under the single GPhone attribute of one row — one tuple, one value per attribute.
- A special value, NULL, represents the unknown or the non-applicable. If a guardian does not share a contact number with the school authorities, GPhone for that tuple is set to NULL, meaning the data is unknown.
A quick map for revision — Property 1: attributes have unique names, column order does not matter. Property 2: tuples are distinct, row order does not matter. Property 3: one domain per attribute, atomic single values only, NULL for unknown or non-applicable data.
Do not read NULL as zero or as an empty string. NULL is a marker that a value is unknown or does not apply — a guardian whose phone number is NULL may well have a phone; the school simply does not have the number. …