




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、COMP231 Tutorial 1ER DiagramsE-R DiagramRectangle entity set实体集Ellipse attribute属性Diamond 菱形 relationship set 联系集Double ellipse multivalued attribute 多值Dashed ellipse derived attribute派生属性Double line total participationDouble rectangle weak entity setDouble diamond relationship set for weak entity s
2、etExercise 1A university registrars office maintains data about the following entities: course, including number, title, credits, syllabus, and prerequisites; course offering, including course number, year, semester, section number, instructor(s), timings, and classroom; student, including student-i
3、d, name, and program;instructor, including identification number, name, department, and title. Further, the enrollment of students in courses and grades awarded to students in each course they are enrolled for must be appropriately modeled.Construct an E-R diagram for the registrars office. Document
4、 all assumptions that you make about the cardinality constraints and participation constraints.Entity sets“A university registrars office maintains data about the following entity sets:” (a) course (b) course offering (c) student (d) instructorcoursecourse-offeringstudentinstructorCourse“course incl
5、uding number, title, credits, syllabus, and prerequisites”Entity set?Attribute?Relationship set? Roles?Cardinality constraint?Participation constraint?prerequisitemaincoursecourse_notitlerequirescoursesyllabuscredits“course offering, including course number, year, semester, section number, instructo
6、r(s), timings, and classroom”Course Offeringtimeroomcoursesection_nosemesteryearcourse- offeringis offeredCourse-noWeak Entity SetA weak entity set can be identified uniquely only by considering the primary key of another (owner) entity setOwner entity set and weak entity set must participate in one
7、-to-many relationship set (one owner, many weak entities).Weak entity set must have total participation in this identifying relationship set. Difference between weak entity and existence dependencyWE implies ED but not the other way round. WE has only a partial key but ED may have a primary key BABA
8、BAStudent, Instructor“student, including student-id, name, and program”“instructor, including identification number, name, department, and title”studentnamesidprograminstructortitledeptnameiidEnrollment“Further, the enrollment of students in courses and grades awarded to modeled. students in each co
9、urse they are enrolled for must be appropriately ”studentcourse-offeringenrolsgradeExercise 1A university registrars office maintains data about the following entities: course, including number, title, credits, syllabus, and prerequisites; course offering, including course number, year, semester, se
10、ction number, instructor(s), timings, and classroom; student, including student-id, name, and program;instructor, including identification number, name, department, and title. Further, the enrollment of students in courses and grades awarded to students in each course they are enrolled for must be a
11、ppropriately modeled.Construct an E-R diagram for the registrars office. Document all assumptions that you make about the cardinality constraints and participation constraints.Anymore ?Instructor teaches course.instructorteachescourse-offeringA course-offering does not have to have an instructor.A c
12、ourse-offering has to have an instructor. Partial participationTotal participationtitledeptnameiidFigure 1 E-R diagram for a university registrar office.prerequisitemaincoursecoursesyllabuscreditstimeroomsection_nosemesteryearcourse- offeringis offeredenrollsgradenamesidprogramstudentinstructorteach
13、estitlerequirescourse_noMore Based on Figure 1 , modify the E-R Diagram so as to present the following information. Each instructor must belong to exactly one department. Each department includes dept-id, name, telephone number. Each department must have at least one instructor.DepartmentEach instru
14、ctor must belong to exactly one departmentEach department must have a least one instructor.instructordepartmentbelongstelephone numberdept-idnameExercise 2Design a database to organize the information about a factory and the products that are manufactured there. The relevant information is as follow
15、s:The factory has a number of employees. For each employee you need to store the name, employee number, and salary.Each employee must be an administrative staff or a worker, but not both.Administrative employees must take seminars. For each seminar we keep its id, name and date. For the administrati
16、ve staff, you must store the grade received, for each seminar taken.The factory manufactures a number of products and each product is identified by a product id and has a name. A worker is assigned to work on exactly one product; a product has multiple (one or more) workers assigned to it. A large n
17、umber of items are manufactured for each product. Each item has a serial number and a color. Different items of the same product have different serial numbers. However, two items that belong to different products may have the same serial number.Exercise 2Design a database to organize the information
18、 about a factory and the products that are manufactured there. The relevant information is as follows:The factory has a number of employees. For each employee you need to store the name, employee number, and salary.分类 Each employee must be an administrative staff or a worker, but not both.Administra
19、tive employees must take seminars. For each seminar we keep its id, name and date. For the administrative staff, you must store the grade received, for each seminar taken.The factory manufactures a number of products and each product is identified by a product id and has a name.relationship A worker
20、 is assigned to work on exactly one product; a product has multiple (one or more) workers assigned to it. A large number of items are manufactured for each product. Each item has a serial number and a color. Different items of the same product have different serial numbers. However, two items that b
21、elong to different products may have the same serial number.Employee, Administrative staff, WorkerThe factory has a number of employees. For each employee you need to store the name, employee number, and salary.Each employee must be an administrative staff or a worker, but not both.ISAEmployeeAdmini
22、strative staffWorkerSeminarAdministrative employees must take seminars. For each seminar we keep its id, name and date. For the administrative staff, you must store the grade received, for each seminar taken.Administrative staffTakesSeminarProductThe factory manufactures a number of products and eac
23、h product is identified by a product id and has a name. A worker is assigned to work on exactly one product; a product has multiple (one or more) workers assigned to it. WorkerWorks forProductItemA large number of items are manufactured for each product. Each item has a serial number and a color. Di
24、fferent items of the same product have different serial numbers. However, two items that belong to different products may have the same serial number.ItemProductFormsISAEmployeeAdministrative staffWorkerTakesSeminarWorks forProductItemFormsConclusionNotations of E-R DiagramGenerally, we construct an
25、 E-R diagram, by identifying: Entity setsWhat should be entities? Strong or weak entity set?Relationship setsNeed to label roles?AttributesCan be inherited? (generalization or specification)Participation constraints:Total participation or partial participation?Cardinality constraintsOne to one, one
26、to many or many to many?ororQ&AExampleWe want to create database for a bank in which we store: Customers (id, name, city). Accounts (number, balance)Loans (number, amount)Branches (name, city, assets)Each customer can have any number of accounts and loansEach account and loan is associated with one
27、branch. A customer must have either one account or loan in order to be in the databaseThe balance in each account should be $100. The last two constraints cannot be expressed by the ER diagram.SolutionParticipation constraintCardinality constraintExampleWe want to create a very simple database for S
28、CUT in which to record information about professors, students and classes. For each professor we need to store the HK-id, name and office number. For each student we need to store the student-id and nameFor each class the id (e.g., COMP 231) and the name. Each class is taught by exactly one professor.Each student must take at least one class. For each class
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 二零二五年房产尾房代理销售合同
- 2025年度跨境贸易货物通关代理服务合同
- 2025版ISO9000质量认证咨询及全面质量管理体系建设合同
- 2025版房地产项目可持续发展评估与规划合同
- 二零二五年度木工室内木结构搭建与改造合同范本
- 二零二五年度窦琴与配偶关于离婚后子女教育环境维护协议
- 二零二五年建筑工程劳务分包合同范本解析
- 2025版绿色环保瓷砖购销合同
- 2025版供应链管理场购销合同书
- 二零二五版多元化担保反担保合同规范
- 大型化工厂房施工组织设计方案
- 青蓝工程师傅指导总结
- 诺如病毒感染暴发调查和预防控制技术指南(2023版)
- 第5课《运动与摩擦力》教学设计(教科版小学四年级上册科学第三单元)
- 公安消防大队保密安全教育培训PPT课件
- Ⅲ类射线装置使用、销售(不储存)单位规章制度
- 互联网金融发展面临的征信业监管问题探析
- 山东省枣庄市薛城区2021-2022学年高一上学期期中考试语文试题 -- 统编版高一必修上
- 电力电子及电气传动实验指导书
- 成品保护措施(完整版)
- 微型消防站检查、维保记录台账.docx
评论
0/150
提交评论