Should foreign keys become table primary key?
Posted
by Carvell Fenton
on Stack Overflow
See other posts from Stack Overflow
or by Carvell Fenton
Published on 2010-03-30T14:20:19Z
Indexed on
2010/03/30
14:23 UTC
Read the original article
Hit count: 559
Hello again,
I have a table (session_comments) with the following fields structure:
student_id (foreign key to students table)
session_id (foreign key to sessions table)
session_subject_ID (foreign key to session_subjects table)
user_id (foreign key to users table)
comment_date_time
comment
Now, the combination of student_id, session_id, and session_subject_id will uniquely identify a comment about that student for that session subject.
Given that combined they are unique, even though they are foreign keys, is there an advantage to me making them the combined primary key for that table?
Thanks again.
© Stack Overflow or respective owner