开发者

Can you explain what's association relation in database?

开发者 https://www.devze.com 2022-12-21 18:53 出处:网络
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 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消