关系模型跟oracle对象关系数据库.pptVIP

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  4. 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  5. 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  6. 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  7. 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
关系模型跟oracle对象关系数据库

第三章 关系模型及oracle对象关系数据库 关系的定义 关系(relation):一个关系对应一张二维表 元组(tuple):表中的一行即为一个元组 属性(attribute):表中的一列为一个属性,给每个属性起一个名字即属性名(ID,NAME,PHONE,SALES-REP-ID) 主码(primary key):表中的某个属性组,它可以唯一确定元组。each row of data in a table is uniquely identified by a primary key. It must contain a value 外码(foreign key):you can logically relate information from multiple tables using foreign keys. 关系模型 关系模型由关系数据结构,关系操作和关系完整性约束三部分组成。 数据结构 ——关系(二维表),它由行和列组成。 关系操作—— 常见的关系操作包括:选择select,投影project,连接join,除divide,并union,交intersection,差difference等查询query操作和增加insert,删除delete,修改update操作两大部分。 完整性——关系的三类完整性约束 实体完整性 、参照完整性、用户定义的完整性 关系代数 The relational algebra(关系代数) is the basis of SQL. Basic Structure ——Cartesian product(笛卡儿积) Formally, given sets D1, D2, …. Dn a relation r is a subset of D1 x D2 x … x Dn , Thus a relation is a set of n-tuples (a1, a2, …, an) where each ai ? Di (1) Select Operation – Example Notation: ? p(r) p is called the selection predicate Defined as: ?p(r) = {t | t ? r and p(t)} Where p is a formula in propositional calculus consisting of terms connected by : ? (and), ? (or), ? (not) Each term is one of: attribute op attribute or constant where op is one of: =, ?, , ?. . ? Example of selection: ? branch-name=“Perryridge”(account) (2) Project Operation – Example Relation r: Notation: ?A1, A2, …, Ak (r) where A1, A2 are attribute names and r is a relation name. The result is defined as the relation of k columns obtained by erasing the columns that are not listed Duplicate rows removed from result, since relations are sets E.g. To eliminate the branch-name attribute of account ?account-number, balance (account) (3) Union Operation – Example Relations r, s: Notation: r ? s Defined as: r ? s = {t | t ? r or t ? s} For r ? s to be valid: 1. r, s must have the same arity (等目,同元,same number of attributes) 2. The attribute domains must be compatible (e.g., 2nd column of r deals with the same type of values as does the 2nd

文档评论(0)

kelly + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档