Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
3 votes
1 answer
434 views

Does adding a surrogate key get rid of an identifying relationship between two entities?

In the following example, we have a Comments table with a composite primary key (PK) CREATE TABLE Comments ( video_id INT NOT NULL, user_id INT NOT NULL, comment_dt DATETIME NOT NULL, PRIMARY ...
brennvo's user avatar
  • 91
1 vote
1 answer
910 views

How to get a surrogate key value in order to put a foreign key in and create relationship?

I am trying to create two relationships between three tables, using foreign keys with values of primary keys, which are surrogate keys. But I don't understand how to enter the right value in the ...
Sithered's user avatar
  • 127
2 votes
2 answers
688 views

Composite primary key plus a separate (surrogate) id column for foreign key references

I am trying to build a database about locations like so: Country → Region → Town Countries will be populated with a list of pre-defined worldwide countries, regions & towns are input by users. ...
the_peacock's user avatar