Relations, Tuples, Attributes and Domains
The relational model has exactly four structural terms. A relation is a set of tuples, a tuple is one fact, an attribute is a named column and a domain is the set of values that column may hold.
-
DBMS Fundamentals
- Data, Information and Databases
- What a DBMS Is and Why It Exists
- File System versus DBMS
- Advantages and Limitations of a DBMS
- Database Users and the Role of the DBA
- Three Level Architecture and Data Abstraction
- Logical and Physical Data Independence
- Schema, Instance and Metadata
- Database Applications and the Database System Environment
- Database Architecture
- Data Models
-
ER Model
- Entities, Entity Sets and Entity Types
- Types of Attributes in the ER Model
- Keys in the ER Model
- Relationships, Relationship Sets and Degree
- Cardinality and Participation Constraints
- Strong and Weak Entities
- Drawing and Reading ER Diagrams
- Extended ER: Generalisation, Specialisation and Aggregation
- Converting an ER Diagram into Relational Tables
- ER Design Projects
- Relational Model
- Relational Algebra
- Functional Dependencies
-
Normalisation
- Why Normalisation Exists: Anomalies and Redundancy
- First Normal Form
- Second Normal Form and Partial Dependency
- Third Normal Form and Transitive Dependency
- BCNF and BCNF Decomposition
- 4NF, 5NF, Multivalued and Join Dependencies
- Lossless Decomposition and Dependency Preservation
- Complete Worked Normalisation: Unnormalised to BCNF
- Denormalisation and When to Use It
Concept
The relational model describes all data with four terms. Every later idea — keys, constraints, algebra, normalisation — is built from them, so they are worth learning precisely rather than approximately.
| Formal term | Everyday term | Meaning |
|---|---|---|
| Relation | Table | A set of tuples sharing the same attributes. |
| Tuple | Row or record | One complete fact about one thing. |
| Attribute | Column or field | A named property, with a type. |
| Domain | Data type, extended | The set of atomic values an attribute may take. |
attributes
+----------+--------+-------+
| roll_no | name | marks | <- relation schema
+----------+--------+-------+
tuple -> | 21 | Meera | 87 |
tuple -> | 22 | Ravi | 91 | <- relation instance
tuple -> | 23 | Anitha | 78 |
+----------+--------+-------+
degree = number of attributes = 3
cardinality = number of tuples = 3Degree and cardinality
| Term | Counts | Changes when |
|---|---|---|
| Degree (arity) | Attributes — the width | The schema changes. Rare. |
| Cardinality | Tuples — the height | Data changes. Constantly. |
Note that cardinality here means the number of rows in a relation. In the ER model the same word meant the ratio of a relationship. Two unrelated meanings, both examined, so read the question carefully.
Domains
A domain is the set of permitted atomic values for an attribute, together with its meaning. It is more than a data type.
| Attribute | Data type | Domain |
|---|---|---|
| marks | Integer | Integers from 0 to 100 |
| gender | Character | The set { M, F, O } |
| pincode | Character(6) | Exactly six digits |
| dob | Date | Dates in the past |
Atomic means indivisible from the point of view of the model: the DBMS never looks inside the value. Storing "9840012345, 9840099887" in one column breaks atomicity, and it is exactly what first normal form forbids.
The properties of a relation
Six properties follow from a relation being a set of tuples. They are examined directly.
- Each tuple is unique. A set has no duplicate members, so no two tuples of a relation are identical. This is why every relation must have a key.
- Tuples are unordered. There is no first row. Any order you see is an accident of storage, which is why sorting must be requested explicitly.
- Attributes are unordered. Columns are identified by name, not position.
- Attribute names are unique within a relation.
- Every value is atomic. No lists, no repeating groups, no nested tables.
- Every value comes from the attribute domain, or is null.
These two are THE SAME RELATION
+----+-------+ +-------+----+
| id | name | | name | id |
+----+-------+ +-------+----+
| 21 | Meera | | Ravi | 22 |
| 22 | Ravi | | Meera | 21 |
+----+-------+ +-------+----+
Rows reordered, columns reordered. Same set of tuples,
same attribute names, therefore the same relation.Where practice departs from theory
Real products relax two of these properties, and knowing which two is a good interview answer.
| Property | Theory | Practice |
|---|---|---|
| No duplicate tuples | Impossible — a relation is a set | Tables without a primary key can hold duplicate rows. Products work with multisets, not strict sets. |
| Attributes unordered | Identified by name only | Columns have a defined position, and a query that selects every column relies on it. |
| Tuples unordered | No row order at all | True in practice too — never rely on the order rows come back in without asking for it. |
Example
-- Illustration only: the definition makes the four terms concrete.
-- students is the RELATION
-- roll_no, first_name, marks are ATTRIBUTES
-- the type and check together express the DOMAIN
-- each stored row is a TUPLE
-- students ( roll_no INT PRIMARY KEY
-- , first_name VARCHAR(50) NOT NULL
-- , marks INT CHECK ( marks BETWEEN 0 AND 100 ) )
-- degree = 3, always
-- cardinality = however many students exist right nowCommon mistakes
- Swapping degree and cardinality. Degree is columns, cardinality is rows.
- Treating a domain as just a data type. The domain includes the permitted range and the meaning.
- Assuming rows come back in insertion order. They may today and may not tomorrow.
- Storing a list in one column. It breaks atomicity and every operation on that column.
- Believing a table can never hold duplicate rows. A relation cannot; a table without a key can.
Exam and interview questions
- Define relation, tuple, attribute and domain.
- Differentiate degree and cardinality.
- List the six properties of a relation and explain why tuples must be unique.
- What does atomic mean, and which normal form depends on it?
- Name two ways real products depart from the strict relational definition.
Practice
- For a table with columns isbn, title, author, price and eight rows, state the degree and cardinality.
- Write the domain, not just the type, for: pincode, percentage, gender, mobile number.
- Explain in three sentences why unordered tuples is a useful property rather than a limitation.
Conclusion
A relation is a set of tuples over named attributes drawn from domains. Degree counts attributes, cardinality counts tuples, and the six properties — especially uniqueness and atomicity — are the foundation that keys, constraints and normalisation are built on.