user366312
user366312

Reputation: 17026

In the discussion of Database Design, what is the difference between many-to-one and one-to-many cardinality ratio?

I am not talking about NHibernate.

I am talking about ER Model.

In the discussion of Database Design, what is the difference between many-to-one and one-to-many cardinality ratio?

Please give me two separate examples.

Upvotes: 0

Views: 218

Answers (3)

Damir Sudarevic
Damir Sudarevic

Reputation: 22177

  • Department to Employee is one-to-many
  • Employee to Department is many-to-one

enter image description here

Upvotes: 1

nvogel
nvogel

Reputation: 25534

No difference at all. It's just two different ways of describing the same concept.

Upvotes: 1

John K.
John K.

Reputation: 5474

Wikipedia says "In SQL (Structured Query Language), the term cardinality refers to the uniqueness of data values contained in a particular column (attribute) of a database table."...

one to one and one to many refer to this uniqueness between 2 tables... one to many refers to tableA having 1 record that relates to many records in tableB. An example of this would be TableA (persons) holding a set of unique person records...For any particular person you can have many different phone numbers, so tableB (phones) could have "many" phone numbers for a single person record.

many to one refers to TableA having many records that relate to a single record in TableB. An example of this would be TableA (employee) holding many records of employees that relate to a single record in TableB (worklocation) containing an address of a particular building where some of these employees work.

Upvotes: 0

Related Questions