user198729
user198729

Reputation: 63676

Can you explain what's association relation in database?

I thought it was alias for simple foreign key relation,but seems not.

Can you take MySQL as an example what is association relation?

I guess it means many2many relation,is that true?

Upvotes: 4

Views: 4691

Answers (1)

Quassnoi
Quassnoi

Reputation: 425633

You confuse relation and relationship here. These are different concepts.

An association relationship is a class theory concept. This is a relationship between two or more entities that does not imply any limitations on their life cycles.

Say, friendship is an association relationship: a person can be a friend to one or more persons, but when the friendship ends, no actual persons are erased from existence.

In relational databases, this is usually represented with a many-to-many link table with FOREIGN KEY references to the tables holding primary keys of the entities associated.

Upvotes: 5

Related Questions