What's the difference between identifying and non-identifying relationships?

前端 未结 15 1651
迷失自我
迷失自我 2020-11-22 12:02

I haven\'t been able to fully grasp the differences. Can you describe both concepts and use real world examples?

15条回答
  •  渐次进展
    2020-11-22 12:20

    Let's say we have those tables:

    user
    --------
    id
    name
    
    
    comments
    ------------
    comment_id
    user_id
    text
    

    relationship between those two tables will identifiying relationship. Because, comments only can be belong to its owner, not other users. for example. Each user has own comment, and when user is deleted, this user's comments also should be deleted.

提交回复
热议问题