Relational Model Concepts
Relational Model Concepts
The relational model represents a database as a collection of relations (tables). Each relation consists of rows and columns, where each row represents a real-world fact about an entity or a relationship.
1. Domain
A domain is a set of atomic values from which attribute values are drawn.
-
Atomic means indivisible within the relational model.
-
Each domain has:
-
A name
-
A data type
-
A format
-
(Optionally) units of measurement
-
Examples of Domains
-
Names→ character strings -
Social_security_numbers→ 9-digit strings -
USA_phone_numbers→ (ddd)ddd-dddd -
Grade_point_averages→ real numbers between 0 and 4 -
Employee_ages→ integers between 15 and 80
2. Attribute
An attribute is a named role played by a domain in a relation.
-
Each attribute has:
-
A name
-
A domain
-
Example:
The same domain may be used for multiple attributes (e.g., Home_phone and Office_phone).
3. Relation Schema ( Intension)
A relation schema defines the structure of a relation.
Definition
A relation schema is denoted as:
where:
-
R= relation name -
A1, A2, ..., An= attributes
Degree (Arity)
-
The degree of a relation = number of attributes
Example
This relation has degree 7.
4. Relation (Relation State-Extension)
A relation (also called a relation state) is a set of tuples that conforms to a relation schema.
Formal Definition
If R(A1, A2, …, An) is a relation schema, then:
-
A relation is a subset of the Cartesian product of its attribute domains.
-
The relation state changes over time, but the schema is relatively static.
5. Tuple
A tuple is a single row in a relation.
Definition
A tuple is an ordered list:
where each vi ∈ dom(Ai) or is NULL.
Accessing Tuple Values
-
t[Ai]ort.Ai→ value of attributeAi -
t[A1, A3]→ subtuple of selected attributes
Example:
t = <'Barbara Benson', '533-69-1238', '(817)839-8461', '7384 Fontana Lane', NULL, 19, 3.25>
6. Characteristics of Relations
6.1 Ordering of Tuples
-
Tuples are unordered
-
Relations are mathematical sets
-
Different row orders represent the same relation
6.2 Ordering of Attributes
-
Attribute order is logically insignificant
-
Alternative definition treats a tuple as a set of:
This leads to self-describing data.
6.3 Atomic Values and First Normal Form (1NF)
-
All attribute values must be atomic
-
Composite and multivalued attributes are not allowed
-
Multivalued attributes must be represented using separate relations
7. NULL Values
NULL represents:
-
Value unknown
-
Value exists but not available
-
Attribute does not apply
Example
-
Office_phone = NULL → student has no office
-
Home_phone = NULL → unknown or unavailable
Visa_status = NULL → apply to foreign students only
⚠ NULLs introduce ambiguity and should be minimized during design.
8. Interpretation of a Relation
8.1 As Facts
-
Each tuple represents a real-world fact
-
Relation schema represents a general assertion
Example:
asserts that students have these properties.
8.2 Relations Represent Both:
-
Entities (e.g., STUDENT)
-
Relationships (e.g., MAJORS(Student_ssn, Dept_code))
8.3 Predicate Interpretation
-
A relation can be seen as a predicate
-
Each tuple makes the predicate true
-
Uses the closed world assumption:
-
Only stored facts are true
-
9. Relational Model Notation (Summary)
-
R(A1, A2, …, An)→ relation schema (use uppercase letters for schema) -
r(R)→ relation state (use lowercase letters) -
t→ tuple -
R.A→ qualified attribute name -
t[A]→ attribute value in tuple
10. Key Takeaway
The relational model:
-
Represents data using relations
-
Ensures simplicity, mathematical rigor, and data independence
-
Forms the foundation of relational databases and SQL

Comments
Post a Comment