I have some questions about the meaning of identifying relationships from one to many. I read some other related stack overflow questions, but I need a bit more info :)
Suppose we have a Country table and a Cities table. It seems to me that this is an example of a one-to-many relationship. But when I use MySql Workbench to create a one-to-one identification between the two tables, I get the following:
Countries --------- country_id (PK) ... Cities -------- city_id (PK) country_id (PK) ...
We have a composite primary key in the Cities table, and it will allow the following rows in this table (suggests that country_id and city_id are rows for better readability):
1) France, Paris 2) England, London 3) England, Manchester 4) France, London
In order to have the correct path, we need to set the UNIQUE restriction on city_id so that it can belong to only one country. But is it not more clear to just make country_id as NOT_NULL (FK) in the Cities table and get the same effect:
Cities --------- city_id (PK) country_id (FK) (NOT_NULL)
So, is this an identifying or non-identifying relationship? It seems to me that he “logically identifies”, but by definition he is not identifiable, since the parent PC is not part of the child PC. This is a bit confusing :)
source share