关系棋型 数据结构 表(关系) ■数据操纵 ■查询、增加、删除、修改 集合操作(操作对象和操作结果都是关系) 完整性约束 实体完整性,参照完整性,用户定义完整性
11 关系模型 数据结构 表(关系) 数据操纵 查询、增加、删除、修改 集合操作(操作对象和操作结果都是关系) 完整性约束 实体完整性,参照完整性,用户定义完整性
关系糗型的基本概念 关系、元组、属性、分量 候选码、主码、超码、外码、全码 关系模式 关系的性质 实体完整性约束规则 参照完整性约束规则
12 关系模型的基本概念 关系 、元组 、属性 、分量 候选码 、主码 、超码 、外码 、全码 关系模式 关系的性质 实体完整性约束规则 参照完整性约束规则
头系数据库举例 University数据库 name dept_name dept_name building budget 10101 Srinivasan Comp. Sci.65000 90000 12121Wu Finance 90000 Biology Comp. Sci.I Tayle 100000 15151 MozartMusic 40000 22222 Einstein 95000 Elec Eng. Taylor85000 Finance Painter 120000 32343EI Said Histo 60000 Histe Painter50000 33456 5565 course_id title dept_namecredits d8000 70000 58583 BIO-101 Intro to Biology Biology 76543 BI0-301Genetics Biology 76766BIO-399 Computational Biology Biology 83821CS-101 Intro to Computer ScienceComp Sci 98345CS-190 Game Design Comp. Sci. BIO-301 BIO-101 CS-315 Robotic BIO-399BIO-101 CS-319 Image Processing Comp. Sci CS-190 CS-101 CS-347 Database System ConceptsCompSci CS-315 CS-101 Intro to Digital Systems ng CS-319 CS-101 FIN-201 Investment Banking finance CS347Cs-101 HIS-351 World History History 4434433333334 EE-181PHY-101 MU-199 Music Video Production MI PHY-101Physical Principles Physics 13
13 关系数据库举例 University数据库
University数据库模式 student akes ame section course id advise title dept name s id dept_name i id time slot edi time slot id time slot id start time prereq ctor classroom course id name room no ept_name teaches
14 University数据库模式
University数据库模式 Instructor(ID, name, dept name, salary) Deptment(dept name building, budget) Student(ID, name, dept name, tot cred) a Course(course ID, title, dept name, credts) Takes(D, Course ID, semester, year, grade) 15
15 Instructor(ID, name, dept_name, salary) Deptment(dept_name, building, budget) Student(ID, name, dept_name, tot_cred) Course(course_ID, title, dept_name, credts) Takes(ID, Course_ID, semester, year, grade) …… University数据库模式