Loading... # 考前数据库题型总结 ## ER图类 1.课本 > 阅读下面的案例分析,它描述了一家影碟出租公司的数据需求。这家影碟出租公司在全美有几家分公司。每个**分公司**的数据包括分公司的地址(由街道、城市、州和邮政编码组成)和电话号码。每个分公司都有一个分公司编号,在整个公司内部每个分公司的编号都是唯一的。每个分公司都有一些**员工**,其中包括一名经理。经理负责其所在分公司的日常运转。公司员工的数据包括姓名、职位和薪水。每位员工都有一个员工编号,这个编号在公司内也是唯一的。每个分公司都库存许多**影碟**,影碟的数据包括目录编号、影碟拷贝编号、影碟名、影碟分类、每日租金、价格、状态以及主要演员和导演的名字。目录编号唯一标识每张影碟。然而大多数情况下,在一个分公司中,每张影碟同时有好几份**拷贝**,这时使用影碟拷贝编号来标识单个拷贝。影碟的分类包括:动作片、成人片、儿童片、文艺片、恐怖片或科幻片。状态表示该影碟是否还有可供出租的拷贝。在租借影碟之前,**客户**必须先在本地的分公司注册,客户的数据包括名字(first name)和姓(last name)、地址和注册日期。每位客户都有一个在全公司范围内唯一的编号。注册成功后,客户就可以租借影碟了,每次最多只能借十张。每张被租出的影碟应该登记出租编号、客户的全名和编号、影碟拷贝编号、影碟名、每日租金、影碟的租借日期和归还日期。出租编号在整个公司内是唯一的。 (1)确定该影碟出租公司的主要实体类型。 标粗为主要实体类型 (2)确定(1)中实体类型之间的主要联系类型,并给出每个联系的 ER 图 (3)为(2)中每个联系确定多重性约束,并在(b)的 ER 图上标识出每个联系的多重性 ![IMG_20220619_163117.jpg](http://xherlock.top/usr/uploads/2022/06/4063493015.jpg) (4)确定实体类型和联系类型的属性,并在(3)的 ER 图上表示出这些属性。(*直接贴老师的了*) ![image-20220619163355832.png](http://xherlock.top/usr/uploads/2022/06/2924190081.png) (5)确定每个(强)实体类型的候选关键字和主关键字。 DVD拷贝不是强实体,排除 | | 候选关键字 | 主关键字 | | -------- | -------------------------------------------- | --------------- | | Branch | branchNo、address、telephone | branchNo | | Staff | (name,position),staffNo | staffNo | | Client | (firstName,lastName,address)、clientNo | clientNo | | DVD | (dvdCategory,dvdName)、catalogNumber | catalogNumber | (6)综合(1)~(5),用一个 ER 图来表示这家影碟出租公司的数据需求,并请注明支持你的设计的所有假设。 就直接**如上** (7)是否适合引入特殊化/泛化、聚合或组合这些增强的概念。如果适合,请将原 ER 图扩展为带有这些增强概念的 EER 图。 ![image-20220619165239961.png](http://xherlock.top/usr/uploads/2022/06/2877322617.png) 2.课本 ![9A7AF09113BE69624F13E09DD30E814D.png](http://xherlock.top/usr/uploads/2022/06/4172880771.png) ![78197FCF0CD3FAC6A4F5902517A525AC.png](http://xherlock.top/usr/uploads/2022/06/4107125480.png) 进一步ERR ![DA5C8BB13E93D5A2CDE83C9DAC765481.png](http://xherlock.top/usr/uploads/2022/06/3395582100.png) 3.课本 ![2ABCCA51EA2F163E2C2457CA8CF6719A.png](http://xherlock.top/usr/uploads/2022/06/1401698411.png) ![6898EA3C5D3FB46B5CF02C3B355F5897.png](http://xherlock.top/usr/uploads/2022/06/280649609.png) 进一步转换为ERR ![C8992FA663594825AFE8EA84CAA8163B.png](http://xherlock.top/usr/uploads/2022/06/620174634.png) 4.往年期末 > A factory has 10 production workshops, each of which has only three types of employees, workshop leaders, production workers and inspection workers. The information of each employee includes staff number, name, sex, date of joining,telephone number and salary. The workshop leaders have the allowance and date of starting to be the workshop leader to manage the workshop. The production workers have the production speed, and the inspection workers have the inspection speed. The workshop leaders are responsible for the management of the workshop. Each workshop has 1-2 workshop leaders, and each workshop leader only manages one workshop. Each production worker produces several products, and each product is produced by only one production worker. The production workers record the production date and time. Each inspection worker inspects several products, and each product is inspected by only one inspection worker. The inspection workers record the inspection date, time and result. Each workshop has workshop number, address, area, storey height and production condition. Each workshop has only one announcement of production requirement, including opening time, closing time, temperature requirement, humidity requirement, cleaning requirement, work specification and announcement time. Each workshop has three work phone numbers. Each product has the information, including product number, name, size and function. > > (1) According to the system of factory described above, state any reasonable assumptions you make to support your answers. **(Marks: 2)** > > (2) Create an ER/EER model to represent the data used by the factory. **(Marks: 19)** > > (3) Transform the ER/EER model into relational schema and give the relational keys (primary keys, alternate Key, foreign keys) of each relational schema, using directed arcs. **(Marks: 15)**--暂未学 ![image-20220619204146042.png](http://xherlock.top/usr/uploads/2022/06/2008441186.png) ## 范式 1.网上 ![fanshi1.png](http://xherlock.top/usr/uploads/2022/06/3380738380.png) 最后修改:2022 年 06 月 20 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 1 如果觉得我的文章对你有用,请随意赞赏