Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a comp...
#18: Post edited
What are the pros and cons of a composite primary key versus a unique constraint?
Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a composite primary key on those columns. What would the pros and cons of either solution to this be?
#16: Post edited
Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a composite primary key on those columns. What would the pros and cons of either solution to this be?
#15: Post edited
Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a composite primary key on those columns. What would the pros and cons of either solution to this be?
#14: Post edited
Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a composite primary key on those columns. What would the pros and cons of either solution to this be?
#13: Post edited
Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a composite primary key on those columns. What would the pros and cons of either solution to this be?
#12: Post edited
Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a composite primary key on those columns. What would the pros and cons of either solution to this be?
#11: Post edited
Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a composite primary key on those columns. What would the pros and cons of either solution to this be?
#10: Post edited
Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a composite primary key on those columns. What would the pros and cons of either solution to this be?
#9: Post edited
Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a composite primary key on those columns. What would the pros and cons of either solution to this be?
#8: Post edited
Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a composite primary key on those columns. What would the pros and cons of either solution to this be?
#7: Post edited
Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a composite primary key on those columns. What would the pros and cons of either solution to this be?
#6: Post edited
Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a composite primary key on those columns. What would the pros and cons of either solution to this be?
#5: Post edited
Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a composite primary key on those columns. What would the pros and cons of either solution to this be?
#4: Post edited
Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a composite primary key on those columns. What would the pros and cons of either solution to this be?
#3: Post edited
Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a composite primary key on those columns. What would the pros and cons of either solution to this be?
#2: Post edited
Lets say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys are unique.One could either do a unique constraint on those foreign keys or a composite primary key on those columns.- What would the pros and cons of either solution to this be?
- Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique.
- One could either do a unique constraint or a composite primary key on those columns.
- What would the pros and cons of either solution to this be?
#1: Initial revision
What are the pros and cons of a composite primary key versus a unique constraint?
Lets say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys are unique. One could either do a unique constraint on those foreign keys or a composite primary key on those columns. What would the pros and cons of either solution to this be?