Search code examples
databasenormalizationdatabase-normalization

Best way to create these tables


I have the following situation.

We want an reputation table to evaluate Users And Companies.

This reputation table would store the reputation given by an Company to User and vice-versa.

It was suggested that we should create two reputation tables, one for the Users and another for the Companies, both with the same columns.

I dont think thats the best way but I cant find another solution.

Is there any other way we could do that?

thx


Solution

  • You would have a table for the company containing a unique key for that Co. Same for the user.

    I assume the relationship between Co and User is many-to-many.

    You need one more table containing both keys, for Co and User, and two fields, one for Co-rep and one for User-rep. The Co-key and User-key combination would be unique entries for this table.