Doubt SQL tables

0

In 1: 1 relationships I have done otherwise than just today I noticed, in that I transform that 1: 1 to 1: N, where in the table that has N, the primary key is the same as the 1, so it's like 1: 1, but I do not know if this method can generate errors?

Example:

tabela 1
--------------
id_ficha - PrimaryKey
etc..

tabela 2
-------------
id_ficha -PrimaryKey e ForeignKey(tabela1)
etc...
    
asked by anonymous 24.05.2016 / 12:40

1 answer

2

It will not generate errors. The method that will be assumed will be 1: 1 if you do not create the FK_ID in table 2 by relating it to table 1.

However, if you are creating table 2 for normalization, you should at least adopt good data modeling practices - creating the respective PK_ID and FK_ID in table 2.

    
24.05.2016 / 14:20