Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 970
user198729 Avatar asked Oct 16 '25 15:10

user198729


1 Answers

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.

like image 132
Quassnoi Avatar answered Oct 19 '25 09:10

Quassnoi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!