CiccioMiami
CiccioMiami

Reputation: 8256

Is it a good practice to have multiple relationships between two DB tables?

I have two DB tables, ACTIVITY and USER.

In the ACTIVITY table I have 3 fields AssignedTo, CreatedBy and LastModifiedBy that need to be related (1 to many, so that a user can create, modify and be assigned to many activities) with UserId field and primary key of the USER table.

Is it a good practice to create three different relationships between the two tables, all three connected with the primary key, in this case UserId, of the parent table?

Upvotes: 0

Views: 1031

Answers (1)

Luc Franken
Luc Franken

Reputation: 3014

Yes, nothing wrong with that. Just do it, it is correct.

While thinking about it: You might take a look at versioning of records. That is a step further but gives you even more info about who edited a record and when.

Upvotes: 1

Related Questions