版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Chapter 3 Problems 8-16.Use the database shown in Figure P3.8 to answer Problems 8-15.FIGURE P3.8 The Ch03_StoreCo Database Tables1. For each table, identify the primary key and the foreign key(s). If a table does not have a foreign key, write None in the space provided.TABLEPRIMARY KEYFOREIGN KEY(S
2、)EMPLOYEEEMP_CODESTORE_CODESTORESTORE_CODEREGION_CODE, EMP_CODEREGIONREGION_CODENONE2. Do the tables exhibit entity integrity? Answer yes or no; then explain your answer.TABLEENTITY INTEGRITYEXPLANATIONEMPLOYEEYesEach EMP_CODE value is unique and there are no nulls.STOREYesEach STORE_CODE value is u
3、nique and there are no nulls.REGIONYesEach REGION_CODE value is unique and there are no nulls.3. Do the tables exhibit referential integrity? Answer yes or no; then explain your answer. Write NA (Not Applicable) if the table does not have a foreign key.TABLEREFERENTIAL INTEGRITYEXPLANATIONEMPLOYEEYe
4、sEach STORE_CODE value in EMPLOYEE points to an existing STORE_CODE value in STORE.STOREYesEach REGION_CODE value in STORE points to an existing REGION_CODE value in REGION and each EMP_CODE value in STORE points to an existing EMP_CODE value in EMPLOYEE.REGIONNA4. Describe the type(s) of relationsh
5、ip(s) between STORE and REGION.Because REGION_CODE values occur more than once in STORE, we may conclude that each REGION can contain many stores. But since each STORE is located in only one REGION, the relationship between STORE and REGION is M:1. (It is, of course, equally true that the relationsh
6、ip between REGION and STORE is 1:M.)5. Create the ERD to show the relationship between STORE and REGION.The Crows Foot ERD is shown in Figure P3.12. Note that each store is located in a single region, but that each region can have many stores located in it. (Its always a good time to focus a discuss
7、ion on the role of business rules in the creation of a database design.)Figure P3.12 ERD for the STORE and REGION Relationship6. Create the relational diagram to show the relationship between STORE and REGION.The relational diagram is shown in Figure P3.13. Note (again) that the location of the enti
8、ties is immaterial the relationships are carried along with the entity. Therefore, it does not matter whether you locate the REGION on the left side or on the right side of the display. But you always read from the “1” side to the “M” side, regardless of the entity location. Figure P3.13 The Relatio
9、nal Diagram for the STORE and REGION Relationship7. Describe the type(s) of relationship(s) between EMPLOYEE and STORE. (Hint: Each store employs many employees, one of whom manages the store.)There are TWO relationships between STORE and REGION. The first relationship, expressed by STORE employs EM
10、PLOYEE, is a 1:M relationship, because one store can employ many employees and each employee is employed by one store. The second relationship, expressed by EMPLOYEE manages STORE, is a 1:1 relationship, because each store is managed by one employee and an employee manages only one store.NOTEIt is u
11、seful to introduce several ways in which the manages relationship may be implemented. For example, rather than creating the manages relationship between EMPLOYEE and STORE, it is possible to simply list the manager's name as an attribute in the STORE table. This approach creates a redundancy whi
12、ch may not do much damage if the information requirements are limited. However, if it is necessary to keep track of each manager's sales and personnel management performance by store, the manages relationship we have shown here will do a much better job in terms of information generation. Also,
13、you may want to introduce the notion of an optional relationship. After all, not all employees participate in the manages relationship. We will cover optional relationships in detail in Chapter 4, “Entity relationship (ER) Modeling.”8. Draw the ERD to show the relationships among EMPLOYEE, STORE, an
14、d REGION.The Crows Foot ERD is shown in Figure P3.15. Remind students that you always read from the “1” side to the “M” side in any 1:M relationship, i.e., a STORE employs many EMPLOYEEs and a REGION contains many STORES. In a 1:1 relationship, you always read from the “parent” entity to the related
15、 entity. In this case, only one EMPLOYEE manages each STORE and each STORE is managed by only one EMPLOYEE.We have shown Figure P3.15s Visio Professional-generated ERD to include the properties of the manages relationship. Note that there is no mandatory 1:1 relationship available at this point. Tha
16、ts why there is an optional relationship the O symbol next to the STORE entity to indicate that an employee is not necessarily a manager. Let your students know that such optional relationships will be explored in detail in Chapter 4. (Explain that you can create mandatory 1:1 relationships when you add attributes to the entity boxes and specify a manda
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026秋季国家管网集团华南公司(广东省管网公司)高校毕业生招聘笔试参考题库(浓缩500题)带答案详解(综合题)
- 2026中国华能集团有限公司能源研究院高校毕业生招聘考试参考试题(浓缩500题)及答案详解(历年真题)
- 2026秋季国家管网集团西北公司高校毕业生招聘笔试模拟试题(浓缩500题)带答案详解(完整版)
- 2025年下半年河北省沧州市渤海新区事业单位招考易考易错模拟试题(共500题)试卷后附参考答案
- 2026国网广西高校毕业生提前批招聘(约450人)笔试模拟试题浓缩500题及答案详解参考
- 2025国网青海省电力校园招聘(提前批)笔试模拟试题浓缩500题及答案详解(必刷)
- 2026秋季国家管网集团油气调控中心高校毕业生招聘14人考试参考题库(浓缩500题)带答案详解(夺分金卷)
- 2026国网湖南省电力公司高校毕业生提前批招聘笔试参考题库浓缩500题及完整答案详解1套
- 国家管网集团2026届高校毕业生招聘考试备考试题(浓缩500题)含答案详解(能力提升)
- 2025年下半年河北张家口涿鹿县事业单位招聘117人重点基础提升(共500题)附带答案详解
- 河道清淤疏浚投标方案(技术方案)
- 自考美学章节练习题
- 研究生学术表达能力培养智慧树知到答案2024年西安建筑科技大学、清华大学、同济大学、山东大学、河北工程大学、《环境工程》英文版和《环境工程》编辑部
- 初中英语趣味竞赛市公开课一等奖省赛课微课金奖课件
- SL-T+712-2021河湖生态环境需水计算规范
- 出口监管仓库货物入仓清单
- 肉桂课件讲解
- MOOC 大学计算机基础-广西大学 中国大学慕课答案
- 耳穴压豆治疗糖尿病
- 机巷回撤皮带机安全技术措施
- 培养小学生有效使用数学草稿本方法的研究
评论
0/150
提交评论