Are foreign keys really necessary in a database design?

前端 未结 24 2324
执笔经年
执笔经年 2020-11-28 18:08

As far as I know, foreign keys (FK) are used to aid the programmer to manipulate data in the correct way. Suppose a programmer is actually doing this in the right manner alr

24条回答
  •  北海茫月
    2020-11-28 18:31

    Without a foreign key how do you tell that two records in different tables are related?

    I think what you are referring to is referential integrity, where the child record is not allowed to be created without an existing parent record etc. These are often known as foreign key constraints - but are not to be confused with the existence of foreign keys in the first place.

提交回复
热议问题