星空网 > 软件开发 > 数据库

数据库复习③

数据库复习③

2016年6月15日

15:24

Main ER Model ER模型

1. ER模型中的约束constraints有哪些?

   Single value constraints 单值约束

    EX:  a person can have only one father.

  Referential integrity constraints 引用完整性约束

    EX: if you work for a company, it must exist in the database

  Domain constraints 域约束

    EX: peoples’ ages are between 0 and 150.

2.ER图中的各种键Keys概念

   super key 超键

     A super key of an entity set is a set of one or more attributes whose values uniquely determine each entity

    在关系中能唯一标识元组的属性集称为关系模式的超键

  candidate key  候选键

    A candidate key of an entity set is a minimal super key

    不含有多余属性的超键称为候选键

    举例:Customer_id is candidate key of customer

  primary key 主键

     Although several candidate keys may exist, one of the candidate keys is selected to be the primary key

    用户选作元组标识的一个候选键程序主键

  Foreign key 外键

    完整性约束的一种,要求该属性在另一表的某个key中出现。

3.弱实体集Weak Entity Sets

  From https://en.wikipedia.org/wiki/Weak_entity

  In a relational database, a weak entity is an entity that cannot be uniquely identified by its attributes alone; therefore, it must use a foreign key in conjunction with its attributes to create a primary key. The foreign key is typically a primary key of an entity it is related to.

4.ER模型的原则

  • 避免冗余Avoid redundancy
  • 限制弱实体集的使用Limit the use of weak entity sets.
  • 如果选为属性时是时不要使用实体集Don’t use an entity set when an attribute will do.

5.好的ER图举例:

 数据库复习③

6.差的ER图举例:

数据库复习③

数据库复习③

7.ER图举例:

 数据库复习③

ER图练习题链接:http://www.cnblogs.com/zpfbuaa/p/5256187.html 

数据库知识点①~⑤链接:http://www.cnblogs.com/zpfbuaa/p/5358035.html

数据库复习链接①~待更新:http://www.cnblogs.com/zpfbuaa/p/5585349.html

数据库基础知识考题链接:http://www.cnblogs.com/zpfbuaa/p/5442113.html




原标题:数据库复习③

关键词:数据库

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

海运 货运:https://www.goluckyvip.com/tag/99264.html
海运到东方港:https://www.goluckyvip.com/tag/99265.html
国际海运国际海运:https://www.goluckyvip.com/tag/99266.html
发林查班海运:https://www.goluckyvip.com/tag/99267.html
亚历山大港海运:https://www.goluckyvip.com/tag/99268.html
东南亚港口:https://www.goluckyvip.com/tag/99269.html
川藏线自驾游要怎么走才比较划算呢?:https://www.vstour.cn/a/411240.html
去日本入住酒店,东西随意用却有一个特殊“要:https://www.vstour.cn/a/411241.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流