what are the advantages of defining a foreign key

前端 未结 5 1368

What is the advantage of defining a foreign key when working with an MVC framework that handles the relation?

I\'m using a relational database with a framework that

5条回答
  •  遥遥无期
    2020-12-15 16:21

    Foreign keys with constraints(in some DB engines) give you data integrity on the low level(level of database). It means you can't physically create a record that doesn't fulfill relation. It's just a way to be more safe.

提交回复
热议问题