can primary key inbox_id in userinbox foreign key employerinformation , userinformation?
context:
users , employers can send feedback administrator's inbox. feedback stored in table userinbox. (image shown below)
issue:
both userinformation , employerinformation have record_id unique identifier- i'm not sure if can use identifier (message_id) connect userinformation , employerinformation userinbox hard distinguish between 2 record_ids.
it's not idea make inbox_id
foreign key in userinfomation
, employerinformation
, because 1 user may have numbers of feedbacks, user information duplicated many times.
one approach problem using idea of inheritance, meaning both userinformation
, employerinformation
inherit user
table, , user
table keeps common information of userinformation
, employerinformation
record_id
, img_id
. userinbox
table keep record_id
foreign key.
userinformation ------ user ----- employerinformation | userinbox
Comments
Post a Comment