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 / StateAttributeValueIn domain?
0 (Init)β€”β€”β€”
1Age25yes (–)
2Age”twenty”no (not integer)
3Age200no (out of range)

⚠️ Common Mistakes

  • πŸ’‘ A value outside the domain is rejected βž” an Age attribute holds integers in –, never the text β€œtwenty” (column/domain integrity).

🧠 Active Recall