The essentials
In the relational data model, data is organised as a set of relations (tables). Each relation has a name and is made up of rows and columns. The model was proposed by E. F. Codd and is the basis of most DBMS software, called RDBMS (relational DBMS).
Key points
- Attribute: a column of a relation, representing one property (such as RollNo or Name).
- Tuple: a row of a relation, representing one record.
- Domain: the set of allowed values for an attribute, for example the domain of Gender might be {M, F, O}.
- Degree: the number of attributes (columns) in a relation.
- Cardinality: the number of tuples (rows) in a relation.
- Each relation has a unique name; each attribute name within a relation is unique.
- The order of tuples and the order of attributes do not matter.
- No two tuples can be identical (each tuple is distinct).
- Each value in a tuple is atomic (cannot be divided further) and comes from the attribute's domain.
- A missing or unknown value is represented by NULL.
Exam tips
- A table with 6 columns and 40 rows has degree 6 and cardinality 40. A quick memory aid: "degree goes across, cardinality counts down".
- Adding a row changes cardinality, not degree; adding a column changes degree, not cardinality.
Common mistakes
- Swapping degree and cardinality is the most common error.
- NULL is not zero and not an empty string; it means the value is unknown or not applicable.
- Thinking the first row of the table is "special". Tuples have no fixed order in the relational model.
Practice questions
Log in to answer these questions and see the explanations.Create free accountLog in