Domain (Relational Model)
Context: FIT2094_MOC Β· the set of valid atomic values an attribute may hold Β· constrains type/format/range Β· enforced as domain integrity
Quick Revision
- π― Objective: the set of valid atomic values an attribute may take β fixes type, format, range.
- π¦ Core Components: β atomic values β column integrity.
- β‘ Key Constraint: values must be atomic (1NF); union-compatibility needs compatible domains.
π Core
1. The Domain
- Definition β the set of valid atomic values an attribute can take.
- Specifies β data type, format, valid range.
- Source β every attribute of a relation draws from a domain.
2. Atomic Values
- Indivisible β one value per attribute per tuple.
- Forbids β a multivalued cell (
dependants={Ali|12,Sara|9}) β 1NF.
3. Domains & Queries
- Column integrity β all values of an attribute from one domain.
- Union-compatibility β set ops need same arity + positionally compatible domains.
Key identities:
When It Flips: a domain is a logical constraint; the DBMS maps it to a concrete column type at physical design. The FIT1058 number sets are example numeric domains.
π Exam Execution Trace
Manual Execution Trace
Validating attribute values:
| Step / State | Attribute | Value | In domain? |
|---|---|---|---|
| 0 (Init) | β | β | β |
| 1 | Age | 25 | yes (β) |
| 2 | Age | βtwentyβ | no (not integer) |
| 3 | Age | 200 | no (out of range) |
β οΈ Common Mistakes
- π‘ A value outside the domain is rejected β an
Ageattribute holds integers in β, never the text βtwentyβ (column/domain integrity).
π§ Active Recall
What is a domain, and how does it relate to data integrity?
- Hint: Valid-value set per attribute.
Answer
- Short answer: The set of valid atomic values (type/format/range); enforces column/domain integrity.
- Why: Same domain β
Ageaccepts β integers, not βtwentyβ.
Why must domain values be atomic, and where do compatible domains matter?
- Hint: 1NF + union-compatibility.
Answer
- Short answer: Atomic = one value per cell (1NF); set operations need union-compatible relations (same arity, compatible domains).
- Why: Forbids multivalued cells β
dependants={Ali,Sara}breaks atomicity.