數(shù)據(jù)庫(kù)考試題及答案_第1頁(yè)
數(shù)據(jù)庫(kù)考試題及答案_第2頁(yè)
數(shù)據(jù)庫(kù)考試題及答案_第3頁(yè)
數(shù)據(jù)庫(kù)考試題及答案_第4頁(yè)
數(shù)據(jù)庫(kù)考試題及答案_第5頁(yè)
免費(fèi)預(yù)覽已結(jié)束,剩余65頁(yè)可下載查看

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、、12分用英文解釋1、DBMS 2、Data Dictionary 3、單項(xiàng)選擇題習(xí)題、Transaction 二、10 分1. There may be instances where an attribute has a set of values for a specificen tity. This type of attribute is said to be【】A. single valued attribute B.multivalued attributeC . simpie attribute D.comp osite attributecustomer to loan is

2、 【】2 . In a p articular bank, a loa n can bel ong to only one customer, and a customercan have several loa ns, the n the relati on shi p set fromA. one to many B . many to many C . many to one D . one to one3 . A【】contains metadata that is, data about data.A. table B . view C . data dictionary D . t

3、rigger4 . The phrase“greater than at least one ” is represented in SQL by【】A. >all B . <all C . <some D . >some5 . In general, all aggregate functions except【】ignore null values in their input collectio n.A. sum B . avg C . min D . count6. If a schedule S can be transformed into a schedu

4、le S' by a series of swaps ofnon-con flict ing in struct ions, we say that S and S'ar e【】7.A.8.A. non-con flict ing equivale ntBC. non-con flict ing serializable D.con flict equivale nt.conflict serializableThe fun dame ntal op erati ons in the relati onal algebra areU, - ,X,n 和 c B . U, - ,

5、x,n 和 cU,n,X,n 和 c D . U,G,x,n 和 cIn SQL, =someis ide ntical toin, and【】is identical to【】。not in 。A.v>some?B =all C . <>all?D . =some9 . The result of true and null is 【】。A. nullB . true C . false D . not null10 . The fun cti onsum app lied on the collecti on 1,1,3,4,4,11 retur ns the value

6、【】.A . 24?B. 6 C . 4?D. 11三、10分設(shè)有Course(課程)、Teacher(教師)、Student(研究生),其中:1、Course有屬性cno(課程號(hào))、cname(課程名)和mark(學(xué)分);2、Teacher有屬性tno(教師編號(hào))、tname(教師姓名)和major(專業(yè)屬性);3、Student有屬性sno(學(xué)號(hào))、sname(學(xué)生姓名)、age(年齡)、bno(班級(jí)號(hào))、score(總成績(jī)) 屬性。4、Teacher 與 Student 之間有指導(dǎo)論文的聯(lián)系,用 Supervise 表示,每位教師可指導(dǎo)多名研究生,每名研究生有且只能有一位指導(dǎo)教師;5、T

7、eacher與Course之間有講授的聯(lián)系,用Teach表示,每位教師可以教授多門課程,每門課程可同時(shí)由多位教師開(kāi)設(shè)。試畫出 E-R 圖。四、12分題設(shè)與第三題相同,試根據(jù)你所畫的E-R圖,設(shè)計(jì)出關(guān)系數(shù)據(jù)庫(kù),并指出每個(gè)關(guān)系中的主鍵和外鍵。五、8 分 題設(shè)與第三題相同,試用關(guān)系代數(shù)表達(dá):1檢索編號(hào)為t01 '的老師的姓名2.檢索班級(jí)號(hào)為b01 '或者年齡大于21歲所有學(xué)生的姓名 六、12分題設(shè)與第三題相同。使用SQL表達(dá):1.建立表結(jié)構(gòu) Course(課程)、Teacher(教師)、Student(研究生)其中要求 age 大于零;定義必要的主鍵和外鍵) 。2.將學(xué)號(hào)為” aOT

8、 ,姓名為” zhang” ,年齡為” 22”的學(xué)生信息加入到 Student表中3檢索專業(yè)為'計(jì)算機(jī)'的老師的姓名和編號(hào) , 并按編號(hào)由大到小排列4將學(xué)號(hào)以a01 '開(kāi)頭的學(xué)生信息刪除。5.檢索比bO1 '班所有學(xué)生的總成績(jī)都高的學(xué)生的姓名,去掉重復(fù)的姓名。6. 檢索張山老師所教的學(xué)生的平均總成績(jī)(假設(shè)不存在教師重名現(xiàn)象)。七、12分設(shè)有屬于1NF的關(guān)系模式R=( A, B, C, D, E),R上的函數(shù)依賴集F= BC?ADAD?EB E?C 。1. R是否屬于3NF?為什么?2. R是否屬于BCNF為什么?八、12 分 設(shè)有屬于1NF的關(guān)系模式R=( A,

9、 B, C, D, E ),R上的函數(shù)依賴集F包含如下 函數(shù)依賴 F=AB?C, D?A, E?C, B?CD, B?A1、求X=BD關(guān)于F的閉包X+.2、求F的一個(gè)正則覆蓋.3、求滿足3NF分解的關(guān)系模式九、12分設(shè)有如下調(diào)度S。T1T2T3read(B)write(B)read(B)read(A)write(B)write(A)read(B)write(B)read(A)write(A)read(A)write(A)a)判別S是否為沖突可串行化調(diào)度?2.如果是沖突可串行化調(diào)度,則給出與 S沖突等價(jià)的串行調(diào)度。習(xí)題答案八、12分用英文解釋(每題3分)3、DBMSA database man

10、ageme ntsystem con sists of a collecti onof in terrelateddata and a collecti on of p rograms to access those data.4、Data dicti on ary: A data dictio nary is a file that contains metadata, thatis data about data.5、Tran sacti on: The tran sact ion is a unit of p rogram executi on that accessesand P os

11、sibly up dates various data items.九、10分單項(xiàng)選擇題(每題1分)1.【Bl2.【A 3.【Cl 4.【Dl 5.【Dl 6.【Bl 7.【Al8.【Cl9.【A 10.【Al5分(2)(3)十、10其相關(guān)屬性Stude n描述出Teacher和Student之間為1對(duì)多關(guān)系-1分描述出Teacher和Course之間為多對(duì)多關(guān)系-1分矩形、菱形等符號(hào)表示正確-3分卜一、12分Course(cno, cname, mark)主鍵:eno - 2 分Teacher (tno, tname, major) 主鍵: tno主鍵: sno 外鍵: tnotno 和 c

12、noStudent (sno, sname, age, bno, tno,score)-4 分 其中主鍵和外鍵各占 1 分Teach(tno, cno) 主鍵: tno, cno 外鍵:-4分 其中主鍵和外鍵各占1.5分十二、 8 分n tname(? tno=' toi' (Teache")- 4 分n snam? age>21 or ?bno=' b01' (Student)-4分十三、12 分1 create table Course (cno char(4),cname char(10),mark integer,primary key

13、(cno) -1 分create table Teacher (tno char(10),tname char(4),major char(8)primary key (tno) - 1 分create table Student (sno char(10),sname char(10),age integer,tno char(10),bno char(10),score integer,primary key (sno),foreign key (tno) references Teacher (tno),check (age>0) -1 分create table Teach(tn

14、o char(10),cno char(4),primary key (tno,cno),foreign key (tno) references Teacher (tno),foreign key (cno) references Course (cno)2insert into Student(sno,sname,age) values ('a01', 'zhang', 22)3Select tname, tnofrom Teacherwhere major= '計(jì)算機(jī)'4order by tno desc -1.5Delete from S

15、tudent分 order by 語(yǔ)句正確占 0.5 分Where sno like a01%'-1.5分 like 語(yǔ)句表達(dá)正確占 0.5 分5select distinct snamefrom Studentwhere score>(select max(score)from studentwhere bno='b01') -1.5 分6. Select avg(score)From stude ntwhere tno=(Select tnoFrom TeacherWhere tname='張山)-1.5 分十四、12分BC, AD, BE都是候選碼,

16、-4分1.所有屬性都是某個(gè)候選碼的屬性,顯然是3NF -4分2. E >C非平凡依賴, 而E不是R的一個(gè)超碼,R不屬于BCNF -4分十五、12分1. X+=ABDC- 1.5 分2. 正則覆蓋:D?A E?C B?CD -4.5 分 每個(gè)依賴1.5分3. D,AE,CB,C,D B,E-6 分 每個(gè)模式 1.5 分 十六、12分1. S為沖突可串行化調(diào)度。-4分2. 沖突等價(jià)的串行調(diào)度為 <T2, T3, T1> -8 分 十七、 12 分 用英文解釋:6、Transaction7、DBMS8、Data model十八、 20 分 選擇題:1. 一個(gè)關(guān)系中的主鍵() 。A.

17、 不可能多于一個(gè) B. 不可以作為其他關(guān)系的外部鍵C. 可以取空值 D. 不可以是屬性組合2. 在數(shù)據(jù)庫(kù)中,產(chǎn)生數(shù)據(jù)不一致的根本原因是() 。A. 數(shù)據(jù)存儲(chǔ)量太大B. 數(shù)據(jù)冗余C. 未對(duì)數(shù)據(jù)進(jìn)行完整性控制D. 沒(méi)有嚴(yán)格保護(hù)數(shù)據(jù)3. 事務(wù)在執(zhí)行時(shí),所遵循的“要么所有操作全部發(fā)生,要么由于出錯(cuò)而全不發(fā)生”這是事務(wù)的()性質(zhì) .A. 隔離性 B. 持久性C.原子性 D.致性4. ()是數(shù)據(jù)抽象的最低層次,描述數(shù)據(jù)實(shí)際上是怎樣存儲(chǔ)的。A.物理層 B. 邏輯層C.視圖層 D. 子模式層5. 對(duì)數(shù)據(jù)庫(kù)系統(tǒng)進(jìn)行集中控制的人稱為()A.操作系統(tǒng)管理員B. 數(shù)據(jù)庫(kù)管理員C.數(shù)據(jù)庫(kù)操作員 D. 程序員6. A中的

18、一個(gè)實(shí)體至多同B中的一個(gè)實(shí)體相聯(lián)系,而B(niǎo)中的一個(gè)實(shí)體可以同A中任意數(shù)目的實(shí)體相聯(lián)系,貝UA和B之間的映射基數(shù)為()A. 一對(duì)多 B. 一對(duì)一C.多對(duì)一 D. 多對(duì)多7. ()提供定義關(guān)系模式、刪除關(guān)系以及修改關(guān)系模式的命令。A.數(shù)據(jù)定義語(yǔ)言B. 視圖定義語(yǔ)言C.數(shù)據(jù)操縱語(yǔ)言D.動(dòng)態(tài)SQL語(yǔ)言8. 事務(wù)不具有的性質(zhì)有()。A.原子性 B. 可恢復(fù)性C.隔離性 D. 持久性9. 計(jì)算過(guò)程中不忽略Null值的聚集函數(shù)包括()。A. avg ()B. max ()C. min ()D. cou nt ()10.假設(shè)關(guān)系person 包含元組John. Smith, Jeffrey, Mary, Val

19、eria,關(guān)系 customer包含元組John, Jeffrey, Tom。貝U person和customer的集合差運(yùn)算結(jié)果應(yīng)該包含()個(gè)元組。A. 3 B. 2 C. 1 D. 5三、8分請(qǐng)?jiān)O(shè)計(jì)一個(gè)體育比賽技術(shù)統(tǒng)計(jì)數(shù)據(jù)庫(kù)。數(shù)據(jù)庫(kù)對(duì)每個(gè)運(yùn)動(dòng)員保存?zhèn)€人記錄,包 括:姓名、性別、年齡、身份證號(hào)。對(duì)每項(xiàng)比賽存有:比賽編號(hào)、比賽時(shí)間、地點(diǎn)、比分、參加比賽的球隊(duì)名稱。還應(yīng)記錄上場(chǎng)隊(duì)員在每場(chǎng)比賽的統(tǒng)計(jì)數(shù)據(jù),包括:進(jìn)球數(shù)、助攻次數(shù)。畫出相應(yīng)的E-R圖,并加以必要的說(shuō)明。四、五、8分根據(jù)下面的E-R圖設(shè)計(jì)關(guān)系數(shù)據(jù)庫(kù),要求指出相應(yīng)的主鍵和外鍵。12分考慮下圖所示員工數(shù)據(jù)庫(kù)。為下面每個(gè)查詢語(yǔ)句寫出SQL表達(dá)

20、式。empio yee(e mpio yee-n ame, street, city)works (empioyee-name, company-name, salary )company company-name, city )a .找出不為First Bank Corporation工作的所有員工的名字b .修改數(shù)據(jù)庫(kù),使得Jones現(xiàn)在居住在Newtown市c.找出各個(gè)公司員工的平均工資,并按照公司名稱排序(逆序)d.刪除works關(guān)系中的所有元組。六、10分關(guān)于關(guān)系模式R=(A, B, C, D, E)的函數(shù)依賴集F如下所示,A?BCCD?EB?DE?Aa .計(jì)算正則覆蓋Fcb .計(jì)算

21、閉包(AB) +七、10分設(shè)有屬于1NF的關(guān)系模式R=(A, B,C, D, E),R上的函數(shù)依賴集F= A?BCCD?E B?D E?A 。R的兩個(gè)分解(1)n= R1=( A, B, C )和 F2(A, D, E )(2)Z= Ri=( A, B, C )和 F2( C, D, E )試判別n, Z是否為無(wú)損連接分解,為什么?八、10分設(shè)有屬于1NF的關(guān)系模式R=(A, B, C, D, E ), R上的函數(shù)依賴集F= A?BC,CD?E, B?D, A?D 。求滿足3NF分解的關(guān)系模式。九、 10 分 考慮如下所示的優(yōu)先圖,相應(yīng)的調(diào)度是沖突可串行化的嗎?如果是,請(qǐng)給出 串行化調(diào)度次序。

22、參考答案十九、 12 分 用英文解釋:9、Transaction : A transaction is a unit of program execution that accesses andpossibly updates various data items.10、DBM:S A database managementsystem consists of a collection of interrelateddata and a collection of programs to access that data.11、Data model : A collection of conc

23、eptual tools for describing data, datarelationships, data semantics, and data constraints.二十、 20 分 選擇題:A. B.C.A.B.C.A.B.D.A三、 8 分 請(qǐng)?jiān)O(shè)計(jì)一個(gè)體育比賽技術(shù)統(tǒng)計(jì)數(shù)據(jù)庫(kù)。數(shù)據(jù)庫(kù)對(duì)每個(gè)運(yùn)動(dòng)員保存?zhèn)€人記錄,包 括:姓名、性別、年齡、身份證號(hào)。對(duì)每項(xiàng)比賽存有:比賽編號(hào)、比賽時(shí)間、地點(diǎn)、比分、 參加比賽的球隊(duì)名稱。還應(yīng)記錄上場(chǎng)隊(duì)員在每場(chǎng)比賽的統(tǒng)計(jì)數(shù)據(jù),包括:進(jìn)球數(shù)、助攻次 數(shù)。畫出相應(yīng)的 E-R 圖,并加以必要的說(shuō)明。四、8 分 根據(jù)下面的 E-R 圖設(shè)計(jì)關(guān)系數(shù)據(jù)庫(kù),要求指出相應(yīng)

24、的主鍵和外鍵。account (account_number, balance, branch_name) primary key (account_number)foreign key (branch_name)branch (bra nch_n ame, bran ch_city, assets) p rimary key (bra nch_n ame) customer (customer, name, customer_city) p rimary key (customer, name) depo sitor (acco unt_nu mber, customer, name)p r

25、imary key (acco unt_nu mber, customer, name) foreig n key (acco unt_nu mber)SQL表達(dá)式。foreig n key (customer_ name)五、12分考慮下圖所示員工數(shù)據(jù)庫(kù)。為下面每個(gè)查詢語(yǔ)句寫出empio yee(e mpio yee-n ame, street, city)works (empioyee-name, company-name, salary )company company-name, city )a .找出不為First Bank Corporation工作的所有員工的名字select e

26、mpio yee-n amefrom workswhere company-n ame !=' First Bank Corpo rati on b .修改數(shù)據(jù)庫(kù),使得Jones現(xiàn)在居住在Newtown市up date empio yeeset city= ' Newtow n'where employee-name= ' Jones 'c.找出各個(gè)公司員工的平均工資,并按照公司名稱排序(逆序)Select company-name, avg (salary)From worksGroup by company-nameOrder by company-

27、name desc d. 刪除 works 關(guān)系中的所有元組。Delete from works的函數(shù)依賴集 F 如下所示,六、10 分 關(guān)于關(guān)系模式 R=(A, B, C, D, E)A?BCCD?EB?DE?Aa .計(jì)算正則覆蓋Fc b .計(jì)算閉包(AB) +答: FC= A?BC,CD?E,B?D,E?A(AB) +=ABCDE七、10分設(shè)有屬于1NF的關(guān)系模式R=(A, B, C, D, E), R上的函數(shù)依賴集F= A?BCCD?E B?D E?A 。R的兩個(gè)分解(1)n= R1=( A, B, C )和 R(A, D, E )Z= Ri=( A, B, C )和 R( C, D,

28、E )試判別n,Z是否為無(wú)損連接分解,為什么?答:n是無(wú)損連接分解,Z不是無(wú)損連接分解八、10分設(shè)有屬于1NF的關(guān)系模式R=(A, B, C, D, E ),R上的函數(shù)依賴集F= A?BC,CD?E, B?D, A?D 。求滿足3NF分解的關(guān)系模式。答:R仁ABC, R2=CDE, R3=BD九、10分考慮如下所示的優(yōu)先圖,相應(yīng)的調(diào)度是沖突可串行化的嗎?如果是,請(qǐng)給出 串行化調(diào)度次序。T1,T2,T6,T3,T4,T5習(xí)題6二十一、12分用英文解釋:12、View13、DBMS14、Query Lan guage二十二、 10 分 填空題(在下列各小題中的括號(hào)部分省略了數(shù)據(jù)庫(kù)系統(tǒng)的術(shù)語(yǔ),在答題

29、紙上寫好小題號(hào),并在其后用英文填寫相應(yīng)的術(shù)語(yǔ))1. The collection of information stored in the database at a particular momentis called an () of the database.2.A () is a language that enables users to access ormanipulate data as organized by the appropriate data model.3.A person who has such central control over the system

30、is called a).4.Application programs are said to exhibit () if they donot depend on the physical schema, and thus need not be rewritten if thephysical schema changes.5.A (is a collection of conceptual tools for describing data,data relationships, data semantics, and consistency constraints.6.The over

31、all design of the database is called the ().7.An (is a set of the sametypethat share the sameproperties,or attributes.8.We choose a minimal superkey for each entity setfrom among its superkeys; theminimal superkey is termed the entity set).9.Any relation that is not part of the logical model, but is

32、 made visible to auser as a virtual relation, is called a).10.SQL allows the use of () values to in dicate abse nee of in formatio nabout the value of an attribute.三、8分請(qǐng)?jiān)O(shè)計(jì)一個(gè)圖書館數(shù)據(jù)庫(kù),此數(shù)據(jù)庫(kù)中對(duì)每個(gè)借閱者保存讀者記錄,包括:讀 者號(hào)、姓名、地址、性別、年齡、單位。對(duì)每本書存有:書號(hào)、書名、作者、出版社。同書名的書有多本,以便被多個(gè)讀者借閱。對(duì)每本被借出的書應(yīng)記錄借出日期和應(yīng)還日期。畫出相應(yīng)的E-R圖,并加以必要的說(shuō)明。

33、SQL表達(dá)式。四、8分根據(jù)下面的E-R圖設(shè)計(jì)關(guān)系數(shù)據(jù)庫(kù),要求指出相應(yīng)的主鍵和外鍵。五、12分考慮下圖所示員工數(shù)據(jù)庫(kù)。為下面每個(gè)查詢語(yǔ)句寫出empio yee(e mpio yee-n ame, street, city)works (empioyee-name, company-name, salary )company company-name, city )a .找出所有為First Bank Corporation 工作的員工的名字b .修改數(shù)據(jù)庫(kù),使得Jones現(xiàn)在居住在Newtown市 c.找出各個(gè)公司員工的平均工資,并按照公司名稱排序(逆序)d. 為First Bank Corpo

34、ration所有員工增加10%勺薪水。六、10分設(shè)有關(guān)系模式R=(A, B, C, D, E),R上的函數(shù)依賴集F = A?B,CD?E A?C。給出R的一個(gè)無(wú)損連接的BCNF分解。七、10分設(shè)有關(guān)系模式R= (A, B, C, D, E),R上的函數(shù)依賴集F = A?BC, CD?EB?D E?A 。計(jì)算(AB) + ?八、10分設(shè)有屬于1NF的關(guān)系模式R=(A, B, C, D, E), R上的函數(shù)依賴集F = A?BC,C?DE, A?D。求滿足3NF分解的關(guān)系模式。九、10分如下所示的調(diào)度是沖突可串行化的嗎?如果是,請(qǐng)給出串行化調(diào)度次序。T1T2read(B)write(B)read(

35、B)read(A)write(B)write(A)read(A)write(A)參考答案15、二十三、12分用英文解釋:View views are virtual relati ons defi ned by a query Ian guage16、 DBMSA database managementsystem consists of a collection of interrelateddata and a collection of programs to access that data.17、 Query Language A query language in which a

36、user requests information fromthe database.二十四、 10 分 填空題(在下列各小題中的括號(hào)部分省略了數(shù)據(jù)庫(kù)系統(tǒng)的術(shù)語(yǔ),在答題紙上寫好小題號(hào),并在其后用英文填寫相應(yīng)的術(shù)語(yǔ))1.The collection of information stored in the database at a particular momentis called an ( instance ) of the database.2. A ( DML) is a language that enables users to access or manipulate data

37、asorganized by the appropriate data model.DBA).3. A person who has such central control over the system is called a (4. Application programs are said to exhibit ( physical data independence ) if theydo not depend on the physical schema, and thus need not be rewritten if thephysical schema changes.5.

38、 A ( Data Model ) is a collection of conceptual tools for describing data, datarelationships, data semantics, and consistency constraints.database schema).6. The overall design of the database is called the (7. An ( entity ) is a set of the same type that share the same properties, orattributes.8. W

39、e choose a minimal superkey for each entity set from among its superkeys; theminimal superkey is termed the entity sets ( candidate key ).9. Any relation that is not part of the logical model, but is made visible to a(view ).user as a virtual relation, is called a10.SQL allows the use of ( null ) va

40、lues to indicate absence of information aboutthe value of an attribute.三、 8 分 請(qǐng)?jiān)O(shè)計(jì)一個(gè)圖書館數(shù)據(jù)庫(kù),此數(shù)據(jù)庫(kù)中對(duì)每個(gè)借閱者保存讀者記錄,包括:讀 者號(hào)、姓名、地址、性別、年齡、單位。對(duì)每本書存有:書號(hào)、書名、作者、出版社。對(duì) 每本被借出的書應(yīng)記錄借出日期和應(yīng)還日期。畫出相應(yīng)的 E-R 圖,并加以必要的說(shuō)明。四、8 分 根據(jù)下面的 E-R 圖設(shè)計(jì)關(guān)系數(shù)據(jù)庫(kù),要求指出相應(yīng)的主鍵和外鍵。account (account_number, balance, branch_name) primary key (account_

41、number)foreign key (branch_name) branch (branch_name, branch_city, assets) primary key (branch_name) customer (customer_name, customer_city) primary key (customer_name) depositor (account_number, customer_name)primary key (account_number, customer_name) foreign key (account_number)SQL表達(dá)式。foreign key

42、 (customer_name)五、12 分 考慮下圖所示員工數(shù)據(jù)庫(kù)。為下面每個(gè)查詢語(yǔ)句寫出empio yee(e mpio yee-n ame, street, city)works (empioyee-name, company-name, salary )company company-name, city )a .找出所有為First Bank Corporation 工作的員工的名字select empio yee-n amefrom workswhere company-n ame= ' First Bank Corpo rati on b .修改數(shù)據(jù)庫(kù),使得Jones現(xiàn)在

43、居住在Newtown市up date empio yeeset city= ' Newtow n'where empioyee-name= ' Jones c.找出各個(gè)公司員工的平均工資,并按照公司名稱排序(逆序)Select company-n ame, avg (salary)From worksGroup by company-n ameOrder by company-n ame descd. 為First Bank Corporation所有員工增加10%勺薪水。Update worksSet salary=salary*1.1where company-na

44、me= ' First Bank Corporation六、10分設(shè)有關(guān)系模式R=(A, B, C, D, E), R上的函數(shù)依賴集F = A?B, CD?E A?C。給出R的一個(gè)無(wú)損連接的BCNF分解。R1=ABR2=CDER3=AC七、R4=AD10分設(shè)有關(guān)系模式R= (A, B, C, D, E), R上的函數(shù)依賴集F = A?BC, CD?EB?D E?A 。計(jì)算(AB) + ?(AB) +=ABCDE八、10分設(shè)有屬于1NF的關(guān)系模式R= (A, B, C, D, E),R上的函數(shù)依賴集F = A?BC,C?DE, A?D。求滿足3NF分解的關(guān)系模式。R1=ABCR2=CDE

45、九、 10 分 如下所示的調(diào)度是沖突可串行化的嗎?如果是 請(qǐng)給出串行化調(diào)度次序。1.是2. T1,T2二十五、12分用英文解釋:18、 Query Lan guage19、First normal form (1NF)T1T2read(B)write(B)read(B)read(A)write(B)write(A)read(A)write(A)習(xí)題120、View二十六、 10 分 填空題(在下列各小題中的括號(hào)部分省略了數(shù)據(jù)庫(kù)系統(tǒng)的術(shù)語(yǔ),在答題紙上寫好小題號(hào),并在其后用英文填寫相應(yīng)的術(shù)語(yǔ))1. An ( ) is an object that exists in the real world

46、and is distinguishable fromother objects.2. The overall design of the database is called the ( ).3. We say that a schedule S is ( ), if it is conflict equivalent to a serialschedule.4. A ( ) is an association among several entities.5. Let R be a relation schema. A subset K of R is a ( ) of R if, in

47、any legalrelati on r(R), for all p airs 11 a nd t2 of t uples in r such that ti 豐 12, the n t iK豐t 2K.6. Underlying the structure of a database is the ( ): a collection of conceptualtools for describing data, data relationships, data semantics, and dataconstraints.7. A ( ) is a language that enables

48、 users to access or manipulate data.8. A database schemais specified by a set of definitions that are expressed usinga ( ).9. A ( ) is a unit of program execution that accesses and possibly updates variousdata items.lO.The ( ) allows a tran sacti on to lock a new data item on ly if that tran sacti o

49、nhas not yet uni ocked any data item.三、12分設(shè)有屬于1NF的關(guān)系模式R= (A, B, C, D, E ), R上的函數(shù)依賴集F =AC?DE, D?B, AB?C 1、求屬性集的閉包(AD)+.2、R是否屬于3NF ?為什么?3、R是否屬于BCNF ?為什么?四、12分設(shè)有屬于1NF的關(guān)系模式R=( A, B, C, D, E), R上的函數(shù)依賴集F=C?ADAB?CD BE?C E?C 。1. 把R分解成Ri=( A, C, E ) 和F2(B, D, E ),試判別此分解是否為無(wú)損連接分解?2 .求F的一個(gè)Canonical Cover (正則覆蓋

50、,規(guī)范覆蓋);3.給出R的一個(gè)分解,使其滿足下列三個(gè)條件: 分解后的每一個(gè)關(guān)系模式都屬于 3NF; .無(wú)損連接; 保持依賴。五、8分考慮如下所示的調(diào)度S.1、判別S是否為沖突可串行化調(diào)度?2、如果是,請(qǐng)給出與S沖突等價(jià)的串行調(diào)度.TiT2T3read(A)write(A)read(A)read(B)wnte(A)read(A)write(B)read(B)write(A)write(B)read(B)write(B)六、16分設(shè)有實(shí)體c (建筑公司)、e (員工)、P (建筑工程項(xiàng)目),其中:6、c有屬性c# (公司編號(hào))、cn和cl ;7、e有屬性e# (員工編號(hào))、en、ex和dob;8

51、p有屬性p# (建筑工程項(xiàng)目編號(hào))、pn、pb。9、e與p之間有員工參加建筑工程項(xiàng)目的聯(lián)系,用 ep表示,一名員工可以參加多項(xiàng)建筑工程項(xiàng)目,一個(gè)建筑工程項(xiàng)目可以由多名員工參加;10、一名員工參加一個(gè)建筑工程項(xiàng)目有獎(jiǎng)金bo11、一名員工必屬于而且只屬于一個(gè)建筑公司,一個(gè)建筑公司可以有多個(gè)員工。員工與公司間的屬于聯(lián)系用ce表示;1、試畫出E-R圖。2、試根據(jù)所畫的E-R圖,設(shè)計(jì)出關(guān)系數(shù)據(jù)庫(kù)。七、12分設(shè)有關(guān)系數(shù)據(jù)庫(kù):d (d#, dn, dx, da, dt, s# )p (p#, pn, px, w# )dp (d#, p#, wa)s (s#, sn, sl )12、d#、dn、dx、da、

52、dt 依次分別表示醫(yī)生的編號(hào)、姓名、性別、年齡、職稱;13、p#、pn和px依次分別表示住院患者的編號(hào)、姓名和性別;14、s#、 sn 和 sl 依次分別表示醫(yī)院科室的編號(hào)、名稱和地址;15、W#表示病房編號(hào);16、wa表示工作量;17、關(guān)系 dp 表示醫(yī)生治療患者的聯(lián)系。試用關(guān)系代數(shù)表達(dá):1、求職稱為 prof 的醫(yī)生的姓名和年齡。2、求姓名為wang的醫(yī)生治療的患者的編號(hào)和姓名。3、求治療w2號(hào)病房的所有患者的男(用 m表示)醫(yī)生的編號(hào)。八、12分題設(shè)與第七題相同。試用SQL表達(dá):1、求屬于S3號(hào)(即為科室編號(hào))科室的女醫(yī)生(用f表示)的編號(hào)和姓名。2、求年齡比S5號(hào)(科室編號(hào))的所有醫(yī)生

53、的年齡都大的醫(yī)生的姓名和年齡。3、求患者的編號(hào)和姓名,并按照患者編號(hào)的升序排列。九、6分題設(shè)與第七題相同。試根據(jù)下述應(yīng)用的需要,用SQL定義view,此view的名稱為 aage。應(yīng)用:求每個(gè)科室的編號(hào)和此科室的醫(yī)生的平均年齡。答案二十七、 12 分 用英文解釋:21、 Query Language A query language in which a user requests information fromthe database.22、 First normal form (1NF) A relation schema R is in first normal form if the

54、23、domain of all attributes of R are atomic.View are virtual relations defined by a query language二十八、 10 分 填空題(在下列各小題中的括號(hào)部分省略了數(shù)據(jù)庫(kù)系統(tǒng)的術(shù)語(yǔ),在答題紙上寫好小題號(hào),并在其后用英文填寫相應(yīng)的術(shù)語(yǔ))1. An ( entity ) is an object that exists in the real world and is distinguishablefrom other objects.database schema).2. The overall design of the database is call

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論