<bdo id='9AAiZ'></bdo><ul id='9AAiZ'></ul>
<legend id='9AAiZ'><style id='9AAiZ'><dir id='9AAiZ'><q id='9AAiZ'></q></dir></style></legend>

    <tfoot id='9AAiZ'></tfoot>
    1. <i id='9AAiZ'><tr id='9AAiZ'><dt id='9AAiZ'><q id='9AAiZ'><span id='9AAiZ'><b id='9AAiZ'><form id='9AAiZ'><ins id='9AAiZ'></ins><ul id='9AAiZ'></ul><sub id='9AAiZ'></sub></form><legend id='9AAiZ'></legend><bdo id='9AAiZ'><pre id='9AAiZ'><center id='9AAiZ'></center></pre></bdo></b><th id='9AAiZ'></th></span></q></dt></tr></i><div id='9AAiZ'><tfoot id='9AAiZ'></tfoot><dl id='9AAiZ'><fieldset id='9AAiZ'></fieldset></dl></div>

    2. <small id='9AAiZ'></small><noframes id='9AAiZ'>

      定义外键有什么好处

      时间:2024-04-16

          <tfoot id='0MXhd'></tfoot>
        • <legend id='0MXhd'><style id='0MXhd'><dir id='0MXhd'><q id='0MXhd'></q></dir></style></legend>

            <bdo id='0MXhd'></bdo><ul id='0MXhd'></ul>

              <small id='0MXhd'></small><noframes id='0MXhd'>

                <tbody id='0MXhd'></tbody>
              <i id='0MXhd'><tr id='0MXhd'><dt id='0MXhd'><q id='0MXhd'><span id='0MXhd'><b id='0MXhd'><form id='0MXhd'><ins id='0MXhd'></ins><ul id='0MXhd'></ul><sub id='0MXhd'></sub></form><legend id='0MXhd'></legend><bdo id='0MXhd'><pre id='0MXhd'><center id='0MXhd'></center></pre></bdo></b><th id='0MXhd'></th></span></q></dt></tr></i><div id='0MXhd'><tfoot id='0MXhd'></tfoot><dl id='0MXhd'><fieldset id='0MXhd'></fieldset></dl></div>

              • 本文介绍了定义外键有什么好处的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                在使用处理关系的 MVC 框架时定义外键有什么好处?

                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 allows model definitions with relations. Because the foreign keys are defined through the models, it seems like foreign keys are redundant. When it comes to managing the database of an application in development, editing/deleting tables that are using foreign keys is a hassle.

                完全放弃使用外键是否有任何好处?

                Is there any advantage to using foreign keys that I'm forgoing by dropping the use of them altogether?

                推荐答案

                带有约束的外键(在某些数据库引擎中)为您提供低级别(数据库级别)的数据完整性.这意味着您无法物理创建不满足关系的记录.这只是一种更安全的方式.

                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.

                这篇关于定义外键有什么好处的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:音乐库 MySQL 数据库 下一篇:在 cmakelist.txt 中添加和链接 mysql 库

                相关文章

                  <bdo id='MZFDe'></bdo><ul id='MZFDe'></ul>

                <small id='MZFDe'></small><noframes id='MZFDe'>

                <i id='MZFDe'><tr id='MZFDe'><dt id='MZFDe'><q id='MZFDe'><span id='MZFDe'><b id='MZFDe'><form id='MZFDe'><ins id='MZFDe'></ins><ul id='MZFDe'></ul><sub id='MZFDe'></sub></form><legend id='MZFDe'></legend><bdo id='MZFDe'><pre id='MZFDe'><center id='MZFDe'></center></pre></bdo></b><th id='MZFDe'></th></span></q></dt></tr></i><div id='MZFDe'><tfoot id='MZFDe'></tfoot><dl id='MZFDe'><fieldset id='MZFDe'></fieldset></dl></div>
                <tfoot id='MZFDe'></tfoot>
              • <legend id='MZFDe'><style id='MZFDe'><dir id='MZFDe'><q id='MZFDe'></q></dir></style></legend>