Backendless Support
 
Answered

Many to many relation

Hi, I have two tables 'Users' and 'Skills'. According to my system there is a many to many relation between the these table and this can be achieved using a bridge table.

I want to save every user's skill's rating and this can be done by saving the rating attribute in bridge table, where the a rating is along every user's skill because a user can have many skills and skill has its own rating.

So far i have created the relation between the tables and it is working fine but there is problem. The problem is i don't know where to put the rating attribute to save every user's skill's rating. Kindly help.

i have attached a picture that shows the relationship.

Leave a Comment

Comments (5)

photo
1

Hi,

Since various skills can be "shared" between users, it would not make sense to put the skillRating column into Skills. It seems that "skillRating" is a property that belongs to a user, so I would put it right into the Users table.

Regards,

Mark

photo
1

i think you didn't understand my question, actually every user has a overall rating and also every skill's rating that he may has.

photo
1

Sorry, I indeed didn't understand at first.

Try creating the UserSkillRating table which would have a relation to User, corresponding skill and the rating for the mapping.

Regards,

Mark

photo
1

Sorry I didn't understand what are you saying. will you please explain it. it would be a great favour.

BTW the table would look alike if there is a bridge table

Users Skills Bridge Table

----------------- -------------------- ----------------------

user_primary key skill_primary key user_primary key

name name skill_primary key

email rating

user_rating

photo
1

This is what I mean:

545f33645c9534cbf877b414634fe674