mhrzn
mhrzn

Reputation: 389

relationship type,degree, cardinality, optionality terms confusion

I currently studying database i've seen degree and cardinality uses as same term, or in some other degree is defined as no. of entities involved in a relationship and further catogories as unary, binary and trenary.

Some placed degree is defined as The degree of a relationship type concerns the number of entities within each entity type that can be linked by a given relationship type.

Cardinality is minimum and maximun number of entity occurrence associated with one occurrence of the related entity

cardinality types as 1 to 1 , 1 to many , many to many. or min and max cardinality.

Min degree is optionality and maximum degree is cardinalty.

what is the difference between degree and cardinaltiy ?

In another context cardinality is a number of rows in table and degree is a number of columns.

So what i'm i suppose to write if question is asked "Define cardinality ?".

Can somebody explain ?

Upvotes: 9

Views: 96054

Answers (6)

Rashmitha Himath
Rashmitha Himath

Reputation: 21

Degree of a relationship is different from 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)

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)

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

Upvotes: 2

Emmanuel Motsi
Emmanuel Motsi

Reputation: 91

It would be good to take note of a distinction when referring to this definition:

  • Degree of a Relationship differs from,
  • Degree of a Relation

Good definitions for both have been given above, just take note of this so that the different definitions don't end up confusing you.

Upvotes: 0

user1439322
user1439322

Reputation: 51

Degree - number of attributes (columns) in a relation (table)

Cardinality - number of tuples (rows) present in a table

See this for more details.

Upvotes: 4

isharailanga
isharailanga

Reputation: 595

Degree of a Relationship : The number of participating entities in a relationship. This can be unary, binary, ternary, quaternary, etc

Cardinality : The number of relationship instances an entity can participate in. Ex: 1:1, 1:Many, Many:N

(Min,Max) notation : Minimum represents the participation constraints while Maximum stands for the cardinality ratio.

Degree of a relation : Number of columns(attributes) in a relation(table).

Upvotes: 3

wendykcoding
wendykcoding

Reputation: 57

To add to the first answer: Simply

Degree of a Relation - Number of attributes in a relation Cardinality of a Relation - Number of tuples in a relation.

Can't post the image to show you but you can check out this book to read up more and get a better picture. Also there is Connolly and Begg - Database Systems, 4th Edition Reference:

Elmasri, R., Navathe, S.B., 2011. Fundamentals of Database Systems. 6th ed. United States of America: Pearson.

Upvotes: 3

madu
madu

Reputation: 354

Ok here is the explanation

1.Degree. This is the number of entities involved in the relationship and it is usually 2 (binary relationship) however Unary and higher degree relationships can be exists.

2.Cardinality. This specifies the number of each entity that is involved in the relationship there are 3 types of cardinality for binary relationships

  • one to one (1:1)
  • one to many (1:n)
  • many to many (n:m)

hope this will clear your mind. Please communicate for more information

Upvotes: 5

Related Questions