Are foreign keys really necessary in a database design?

前端 未结 24 2371
执笔经年
执笔经年 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:27

    You can view foreign keys as a constraint that,

    • Help maintain data integrity
    • Show how data is related to each other (which can help in enforcing business logic and rules)
    • If used correctly, can help increase the efficiency with which the data is fetched from the tables.

提交回复
热议问题