π 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) |