Database Management System (DBMS) / Relational Model

Degree & Cardinality of a relation

πŸ” Degree of Relation

In a Relational Database, the Degree of a relation refers to the number of attributes (columns) in that relation (table).

πŸ” Degree of a Relation = Total number of attributes (columns) in the relation (table).


πŸ“Š Example Table: Students

πŸ†” StudentID

πŸ‘€ Name

πŸŽ‚ Age

πŸŽ“ Major

101

Alice

20

Computer Science

102

Bob

22

Mathematics

  • This table has 4 attributes:

    • πŸ†” StudentID

    • πŸ‘€ Name

    • πŸŽ‚ Age

    • πŸŽ“ Major

βœ… Degree = 4


πŸ” Cardinality of Relation

In a Relational Database, the Cardinality of a relation refers to the number of tuples (rows) in that relation (table).

πŸ” Cardinality of a Relation = Total number of tuples (rows) in the relation (table).


πŸ“Š Example Table: Students

πŸ†” StudentID

πŸ‘€ Name

πŸŽ‚ Age

πŸŽ“ Major

101

Alice

20

Computer Science

102

Bob

22

Mathematics

103

Zara

21

Physics

  • This table has 3 tuples (records/rows)

βœ… Cardinality = 3


πŸ“Œ Quick Comparison:

Term

Meaning

πŸ“˜ Relation

A table

πŸ“Œ Attribute

A column (field)

πŸ“„ Tuple

A row (record)

πŸ“ Degree

Number of attributes (columns)

πŸ”’ Cardinality

Number of tuples (rows)