欢迎来到第壹文秘! | 帮助中心 分享价值,成长自我!
第壹文秘
全部分类
  • 幼儿/小学教育>
  • 中学教育>
  • 高等教育>
  • 研究生考试>
  • 外语学习>
  • 资格/认证考试>
  • 论文>
  • IT计算机>
  • 法律/法学>
  • 建筑/环境>
  • 通信/电子>
  • 医学/心理学>
  • ImageVerifierCode 换一换
    首页 第壹文秘 > 资源分类 > PPT文档下载
    分享到微信 分享到微博 分享到QQ空间

    数据库原理英文课件Chapter3TheRelationalDataModel.ppt

    • 资源ID:464978       资源大小:637.50KB        全文页数:52页
    • 资源格式: PPT        下载积分:10金币
    快捷下载 游客一键下载
    账号登录下载
    三方登录下载: 微信开放平台登录 QQ登录
    下载资源需要10金币
    邮箱/手机:
    温馨提示:
    快捷下载时,如果您不填写信息,系统将为您自动创建临时账号,适用于临时下载。
    如果您填写信息,用户名和密码都是您填写的【邮箱或者手机号】(系统自动生成),方便查询和重复下载。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP,免费下载
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    数据库原理英文课件Chapter3TheRelationalDataModel.ppt

    1Database Principles2Chapter 3The Relational Data ModeluRelational ModeluFunctional Dependencies3Contentsu3.1 Basics of the Relational Modelu3.3 From E/R diagrams to Relational Designsu3.5 Functional Dependenciesu3.7 Design of Relational Database SchemasuReading GuideuExercise4The things you should knowuThe basic principle of relational database is proposed by E.F.Codd in 1970.uThe first RDBMS production is System RuThe most popular RDBMS DB2,Oracle,Ingres,Sybase,Informix,53.1 Basic of the Relational Model uThe relational model gives us a single way to represent data:as a two-dimensional table called a relation.6uAttributes(属性)w Attributes of a relation serve us as names for the columns of the relation.w Usually,the attributes describes the meaning of entries in the column below.7uSchemas(模式)w The name of a relation and the set of attributes for a relation is called the schema for that relation.w We show the schema for the relation with the relation name followed by a parenthesized list of its attributes.8uTuples(元组)w The rows of a relation,other than the header row containing the attributes,are called tuple.For example:w Relations,however,are sets of tuples,and it is impossible for a tuple to appear more than once in a given relation.9uDomains(域)w The relational model requires that each component of each tuple be atomic;that is,it must be of some elementary type such as integers or string.w Each attributes of a relation has particular elementary type,thus domain is decided.10uEquivalent Representations of a Relationw The attributes of the relation can be reordered without change the relation.11uRelation Instance(关系实例)w A relation about movies is not static;rather,relations change over time.w It is not common for the schema of a relation to change.w We shall call a set of tuples for a given relation an instance of that relation.12An Example of Relation InstanceRelation:Person(Name,Address,Telephone)Relation Instance:NameAddressTelephoneBob123 Main St555-1234Bob128 Main St555-1235Pat123 Main St555-1235Harry456 Main St555-2221Sally456 Main St555-2221Sally456 Main St555-2223Pat12 State St555-123513More uRelation(Instance)=a set of tuplesuDatabase=collection of relationsuRelation schema=relation name+attributesw Example:Movies(title,year,length,fileType)uDatabase schema=a set of all relation schemasw Movies(Title,Year,Length,FileType)w Star(Name,Age)w Studio(StudioName,Addr)14Name Addr Tel N1 A1 T1 N2 A2 T2 N3 A3 T3 N4 T4 N5 T5 T6 T7Name Addr Tel N1 A1 T1 N1 A1 T2 N1 A1 T3 .N1 A1 T7 N1 A2 T1 N1 A3 T1 N2 A1 T1TupleDomainComponentAttribute15Integrity Constrain of RelationsuEntity Constrainw The attributes belong to key can not be set as NULL.uReference Constrainw Foreign Key:an non-key attribute A in R is a key in S,then the A is called a foreign key of R.w The value of foreign key can only be NULL or same as what is in S.uUser-define Constrainw Users define the constrains themselves.16补充:关系的完整性u实体完整性u参照完整性u用户定义完整性 实体完整性和参照完整性是关系模型必须满足的,被称作关系的不变性,由关系数据库系统自动支持17实体完整性u规则:若属性A是基本关系R的主属性,则属性A不能取空值u说明:基本关系的主码中的任何属性都不能取空值,而不仅是主码整体不能取空值u依据:现实世界的实体是唯一可分的例:学生(例:学生(学号学号,姓名,性别,专业号,年龄),姓名,性别,专业号,年龄)课程(课程(课程号课程号,课程名,学分),课程名,学分)选修(选修(学号学号,课程号课程号,成绩),成绩)18例:学生实体与专业实体间的关系:例:学生实体与专业实体间的关系:学生(学生(学号学号,姓名,性别,专业号,年龄),姓名,性别,专业号,年龄)专业(专业(专业号专业号,专业名),专业名)关系参照图外码外码参照关系参照关系被参照关系被参照关系例:学生,课程,学生与课程之间的多对多联系:例:学生,课程,学生与课程之间的多对多联系:学生(学生(学号学号,姓名,性别,专业号,年龄),姓名,性别,专业号,年龄)课程(课程(课程号课程号,课程名,学分),课程名,学分)选修(选修(学号学号,课程号课程号,成绩),成绩)关系参照图被参照关被参照关系系参照关系参照关系学生关系专业关系学生关系专业关系专业号专业号学生关系学生关系 选修关系课程关系选修关系课程关系学号学号课程号课程号参照完整性主码?外码?19参照完整性u定义:外码定义:外码w 设F是参照关系R的一个或一组属性,若F与被参照关系S的主码相对应,则称F是R的外码(详细定义见教材P54)u规则:参照关系R中每个元组在外码F上的值必须为:或者取空值(F的每个属性值均为空值)或者等于S中某个元组的主码值例:学生(例:学生(学号学号,姓名,性别,专业号,年龄,班长),姓名,性别,专业号,年龄,班长)参照关系参照关系被参照关系被参照关系外码外码20用户定义完整性u用户定义的、具体应用中的数据必须满足的约束条件w 成绩:0100之间w 身份证、身份证和生日对应关系 213.2 From E/R Diagrams to RelationuFrom Entity Sets to Relationw Simplest approach(not always best):convert each E.S.to a relation.w Create a relation of the same name and with the same set of attributes.22Movies(title,year,length,filmType)Stars(name,address)Studios(name,address)Example23u From E/R Relationships to RelationwRelationships in the E/R model are also represented by relations.The relation for a given relationship R has the following attributes;1.For each entity set involved in relationship R,we take its key attributes as part of the schema of the relation for R.2.If the relationship has attributes,then these are also attributes of relation R.24Example:Owns(title,year,studioname)Stars-in(title,year,starName)25E-RE-R图向关系模型的转换原则图向关系模型的转换原则u一个实体转换为一个关系模式,实体的属性就一个实体转换为一个关系模式,实体的属性就是关系的属性,实体的码就是关系的码是关系的属性,实体的码就是关系的码u对实体间的联系对实体间的联系w 一个一个1:11:1联系可以转换为一个独立的关系模式,也联系可以转换为一个独立的关系模式,也可以与任意对应的关系模式合并可以与任意对应的关系模式合并w 一个一个1:n1:n联系可以转换为一个独立的关系模式,也联系可以转换为一个独立的关系模式,也可以与可以与n n端对应的关系模式合并端对应的关系模式合并w 一个一个m:nm:n联系转换为一个关系模式联系转换为一个关系模式w 三个或三个以上实体间的一个多元联系可以转换为三个或三个以上实体间的一个多元联系可以转换为一个关系模式一个关系模式w 具有相同码的关系模式可以合并具有相同码的关系模式可以合并补充:补充:26如公司部门管理系统的如公司部门管理系统的E-R图及其转换成的关系模式图及其转换成的关系模式部门部门项目项目职工职工电话电话包括包括承担承担

    注意事项

    本文(数据库原理英文课件Chapter3TheRelationalDataModel.ppt)为本站会员(p**)主动上传,第壹文秘仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知第壹文秘(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2023 1wenmi网站版权所有

    经营许可证编号:宁ICP备2022001189号-1

    本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。第壹文秘仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知第壹文秘网,我们立即给予删除!

    收起
    展开