i have a table with two foreign keys as composite key.
ActivityTbl -
(activityNbr(PK), supervisor(FK), status, type, startDate, endDate, location )
VolunteerTbl -
(volunteerNbr(PK), name, address, contact)
Now I created a table where volunteer's choices can be stored as per their prefereance rating.
ActivityChoice
(activityNbr(FK), VolunteerNbr(FK), Rating)
So the combination of those 2 FKs make a composite key. I am using sql Server to create a table.
Create ActivityChoiceTbl(
VolunteerNbr int NOT NULL,
ActivityNbr int NOT NULL,
Rank int NOT NULL,
CONSTRAINT PKActivityChoice PRIMARY KEY (VolunteerNbr,ActivityNbr),
CONSTRAINT CKRank CHECK (Rank>0 AND Rank<=9));
So in this case do I need to add another foreign key constrain for both to mention that they are foreign keys?? Am I doing it right?? Thanks