关系模型及oracle对象关系数据库.pptxVIP

  • 2
  • 0
  • 约3.35千字
  • 约 34页
  • 2022-04-05 发布于江苏
  • 举报
第三章 关系模型及oracle对象关系数据库;关系数据库系统是支持关系模型的数据库系统。 1970年初,IBM公司的高级研究员Dr.E.F.Codd发表论文提出了关系模型,奠定了关系数据库的理论基础。Dr.E.F.Codd proposed the relational model for database systems in 1970s. Vendors: ORACLE(9i ),IBM(DB2) , Microsoft (ACESS and SQLServer), Foxbase(Foxpro), Sybase;关系的定义;主码(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. ;关系模型;关系代数;例如, D1=导师集合= {张清玫,刘逸}, D2 =专业集合= {计算机,信息}, D3 =研究生集合={ 李勇,刘晨,王名} 则 D1 X D2 X D3 ={ (张清玫,计算机,李勇 ) , (张清玫,计算机,刘晨 ) , (张清玫,计算机,王名 ) , (张清玫,信 息,李勇 ) , (张清玫,信 息,刘晨 ) , (张清玫,信 息,王名 ) , (刘 逸,计算机,李勇 ) , (刘 逸,计算机,刘晨 ) , (刘 逸,计算机,王名 ) , (刘 逸,信 息,李勇 ) , (刘 逸,信 息,刘晨 ) , (刘 逸,信 息,王名 ) }, 共12个元组。笛卡儿积可对应一张二维表。 ; basic operators Set intersection 交 Union 并 set difference 差(集合差) Cartesian product 笛卡儿积 Select 选择 Project 投影 Natural join 自然连接 Division 除 The operators take two or more relations as inputs and give a new relation as a result.;(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;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 re

文档评论(0)

1亿VIP精品文档

相关文档