All Questions
Tagged with erd surrogate-key
3 questions
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 ...
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 ...
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.
...