Database: relationship degree and cardinality


The degree of a relationship is different from the degree of a relation (table). Both definitions are likely to get mixed up and cause confusion.

  1. Relation in this context (in relational databases) is synonym to a “table” Whereas,
  2. Relationship is synonym to “a connection between tables (relations)”.

We have to consider both of these characteristics known as “degree” and “cardinality” of

  1. relations (tables) and
  2. relationships

Separately.


1. in a relation (table)

Image Credits: Guru99

i) Degree – Number of fields (columns) in relation.

ii) Cardinality – number of records (rows) in relation.

2. in a relationship

i) Degree – Number of entities (tables) involved in a relationship (Unary, Binary, Ternary, N-array)

Image Credits: learncomputerscienceonline.com

ii) Cardinality – Number of connections that each record (row/data) of an entity might establish with the records of another entity. (One to one, One to many, many to many)

Image Credits: databasestar.com

Leave a Reply

Your email address will not be published. Required fields are marked *