Skip to main content

All Questions

Filter by
Sorted by
Tagged with
2 votes
1 answer
208 views

How to constrain many-to-many to mark a single record as a "default"? [duplicate]

Suppose I have the following entities: customer(id, name) template(id, name) With a junction table: customer_template(id, customerId, templateId, is_default) A customer may have any number of ...
ShooShoSha's user avatar
14 votes
2 answers
9k views

Do I need a separate Id column for this "mapping" table?

I have a table of Producers and a table of Products, both of which are of the form: Id - int, Primary key Name - nvarchar A Producer can carry multiple Products, so I was going to create a table ...
Josh Darnell's user avatar
  • 29.8k