E-R建模及关系表转换习题-2010.doc_第1页
E-R建模及关系表转换习题-2010.doc_第2页
E-R建模及关系表转换习题-2010.doc_第3页
E-R建模及关系表转换习题-2010.doc_第4页
E-R建模及关系表转换习题-2010.doc_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

一、Consider the following information in an airport databasel An airport is described by its name and the city that the airport locates atl Each airplane has a registration number and the date of production as its descriptive attributesl Each airplane model is identified by a model number and has a capacity and a weightl A technician is characterized by technician_id, his name and his phone number l Each airport accommodates a number of airplane models, and an airplane model may appears in several airportsl Each airplane is of a specific model, e.g. Boeing 737; and for each model, there may be more than one airplane being of it l A number of technicians work at the airport, but each technician works at only one airport.l Each technician is responsible for one or more plane models, and one plane model has one or more technicians responsible for itl Each airplane is periodically tested by a number of technicians to ensure that the airplane is still airworthy. A technician may test several airplanes each year.It is required that when a technician tests an airplane, the airplane model that he is responsible for is just the model that the airplane tested is of. The information, such as test number, the testing date, the testing result and the time spent on the test, is needed to describe a testing of the airplane(1) Design the E/R diagram for the airport database on the basis of the information mentioned above Note: the key of the entities, mapping cardinality of each relationship and participation of each entity to the relationship should be described in the diagram. .(10 points)(2) Convert the E-R diagram to the proper relational schema, and give the primary key of each relation schema by underlines. (10 points)Answers:或:(2) (10 points)实体airport归结为: airport(a-name, city); 实体model归结为: model(m-num, weight, capacity); 联系accommodate归结为: accommodate(a-name, m-num); 实体airplane和联系be-of归结为:airplane(re-num, date, m-num); 实体technician、联系work、联系test归结为: technician(t-id, t-name, phone-num, a-name)test(t-id, re-num, t-num, t-date, time, result)联系responsible归结为 responsible(t-id, m-num)如果technician部分参与到联系test中,则如下图所示:关系表转换:实体airport归结为: airport(a-name, city); 实体model归结为: model(m-num, weight, capacity); 联系accommodate归结为: accommodate(a-name, m-num); 实体airplane和联系be-of归结为:airplane(re-num, date, m-num); 实体technician、联系work归结为: technician(t-id, t-name, phone-num, a-name)联系responsible归结为: responsible(t-id, m-num)联系test归结为: test(t-id, re-num, t-num, t-date, time, result)二、Notown Records company needs to store information about songs, albums(专辑) and musicians who perform on its albums in a database. Consider the following information:l Each musicians that records at company has an Id (which is unique), a name , an address, and a phone number.l Each instrument used in company has a name and an ID, ID is unique.l Each album recorded on the Notown label has a title, a copyright date, a format, and an album identifier.l Each song recorded at Notown has a title and an author, and each song can be identified by title.l Each musician may play several instruments, and a given instruments may be played by several musicians.l Each album has a number of songs on it, but no song may appear on more than one album.l Each song is performed by one or more musicians, and a musician may perform a number of songs.l Each album has exactly one musician who acts as its producer. A musician may produce several albums, of course. (1) Design the E/R diagram for hospital database on basis of the information mentioned above .(10 points)Note: mapping cardinality of each relationship and participation of each entity to the relationship should be described in the diagram.(2) Convert the E-R diagram to the proper relational schemas, and give the primary keys of each relation schemas by underlines. (10 points)Answers:(1)addressM_idnameI_idI_nameplayinstrumentmusicianPhone_numberperformproduceS_ttitleitlehavetitlesongalbumauthorformatCopyright_datea_identifier全参与和部分参与可

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论