Relation Properties
Context: FIT2094_MOC Β· the set-derived rules every relation obeys Β· no duplicates, unordered, atomic Β· what separates a relation from a table
Quick Revision
- π― Objective: a relation body is a set of tuples β four properties follow.
- π¦ Core Components: no duplicate tuples β tuples unordered β attributes unordered β atomic values.
- β‘ Key Constraint: atomic values = First Normal Form; access is always by content, never by position.
π Core
1. The Four Properties
- No duplicate tuples β a set has no repeats.
- Tuples unordered β no βfirstβ/βthirdβ tuple; access by content.
- Attributes unordered β access by name, not column position.
- Atomic values β one indivisible value per attribute per tuple.
2. Atomicity = 1NF
- Breaks atomicity β
dependants = {Ali|12, Sara|9}in one cell (repeating values). - 1NF fix β move to a separate relation, not one attribute.
3. Relation vs Table
- Table β may have duplicate/ordered rows, composite cells.
- Relation β forbids duplicates, unordered, atomic β logical structure with integrity.
βοΈ Core Decision Matrix
| Property | From | Consequence |
|---|---|---|
| no duplicates | set | a super key always exists |
| tuples unordered | set | access by content |
| attributes unordered | set | access by name |
| atomic values | 1NF rule | dependencies/joins well-defined |
When It Flips: unordered tuples force declarative Relational Algebra/SQL querying by value; tuple uniqueness guarantees the full attribute set is a super key. SQL tables relax some rules (permit duplicate rows unless constrained).
π Exam Execution Trace
Manual Execution Trace
Checking a candidate relation:
| Step / State | Check | Verdict |
|---|---|---|
| 0 (Init) | β | β |
| 1 | duplicate tuple? | forbidden |
| 2 | access by row number? | invalid |
| 3 | dependants={Ali,Sara} | breaks 1NF |
β οΈ Common Mistakes
- π‘ Never name a tuple by position β tuples are unordered, so access is always by attribute value; a multivalued cell violates atomicity (1NF).
π§ Active Recall
State the four properties of a relation and why each follows from it being a set.
- Hint: Set βΉ properties.
Answer
- Short answer: No duplicate tuples, tuples unordered, attributes unordered, atomic values.
- Why: First three from set β atomicity is the extra 1NF rule.
How does a relation differ from a tabular representation, and the link to 1NF?
- Hint: Display vs structure.
Answer
- Short answer: Tables allow duplicate/ordered rows and composite cells; relations forbid all three.
- Why: 1NF β atomic-value rule moves multivalued data to a separate relation.