Do you absolutely need foreign keys in a database?

后端 未结 11 1161
遥遥无期
遥遥无期 2021-02-12 20:31

I was wondering how useful foreign keys really are in a database. Essentially, if the developers know what keys the different tables depend on, they can write the queries just

11条回答
  •  没有蜡笔的小新
    2021-02-12 21:20

    I think that assuming that programmers will always preserve data integrity is a risky assumption.

    There's no reason why you wouldn't create foreign keys, and being able to guarantee integrity instead of just hoping for integrity is reason enough.

提交回复
热议问题