加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

mysql 外键理解

发布时间:2020-12-12 00:00:43 所属栏目:MySql教程 来源:网络整理
导读:假定一个班级的学生个人信息表: (注意: ) h1 style="color: #333333; font-family: 宋体; line-height: 28px"外键用来干什么? 为了一张表记录的数据不要太过冗余。 h1 style="color: #333333; font-family: 宋体; line-height: 28px"这和软件project的模块

假定一个班级的学生个人信息表:

(注意: )

<h1 style="color: #333333; font-family: 宋体; line-height: 28px">外键用来干什么? 为了一张表记录的数据不要太过冗余。


<h1 style="color: #333333; font-family: 宋体; line-height: 28px">这和软件project的模块化思想差点儿相同类似,仅仅只是在数据库中是对表关系进行解耦,尽量让表 记录的数据单一化。就如你贴的图片中,把成绩和学生信息放在一张表中就太冗余了。
<p style="border-width: 0px; padding-top: 0px; padding-bottom: 0px; margin-top: 0px; margin-bottom: 8px; list-style: none; text-indent: 2em; font-family: 宋体; font-size: 14px; line-height: 28px">


<h1 style="color: #333333; font-family: 宋体; line-height: 28px">为什么说外键能保持数据的一致性、完整性

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读