數(shù)據(jù)庫系統(tǒng)概念答案(第五版)_第1頁
數(shù)據(jù)庫系統(tǒng)概念答案(第五版)_第2頁
數(shù)據(jù)庫系統(tǒng)概念答案(第五版)_第3頁
數(shù)據(jù)庫系統(tǒng)概念答案(第五版)_第4頁
數(shù)據(jù)庫系統(tǒng)概念答案(第五版)_第5頁
已閱讀5頁,還剩12頁未讀 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、C H A P T E R2Exercises2.4 inrelationrelationschema. A relation is a a relation is ( )isa relationssss#name123-45-6789 TomJones456-78-9123 Joe Brownis a relation 2.5 in to fol- all First cities all First citiesall First all in this live in city in cities. all in city in is (works)-person - =78 2Rela

2、tional,city) ,salary) ,city),manager-name) . 2.3 ( 1-person city(works)- = -person street, city (- salary 10000)( = 1 employee) ( 1 1 company)-person in ( - (company)- = city2.6 relation “ all a bank.” to also city in in a in to in tothis effect? toina join this to is( 1 1 customer)-customer name,cu

3、stomer city,amount a is in in joins , in is to into If is If a ) city. a city street. ( 1 loan) 1 customer)-customer name,customer city,amount2.7 in rela- all First a Exercises9 allinthisa In a 3 allinworksrelation (-person name,1salary-)(works)-( name= ( Corporation”(works)- name= situation t ,to1

4、t in 2 (122-works.person name,salary( manages)-works.person name= -works.person name,salary03(t )t .salary 1 10000011 t (-works.person name,salary21(t )t .salary 1 10000011 ( 1) t 2 Corporation”(works)companyname=2.8 to in t G(depositor)-account -customer 1(t )( (depositor) (depositor) (depositor)-a

5、ccount - holders2- - -account holders(account holders)1 t 1123 (t )t-(.account number=.account number=.account number)21(-.account (.customer name=.customer (t )-.customer name=.customer .customer name=.customer name)-22.9 a a First 10 2Relational t G(works)- (-person 1 (t )t- strength employees2 em

6、ployees()1(t )(t ) 1 - t ( employees)1t ( employees)423G(works) 1- salary (t )t-2payroll( payroll( name,payroll)1(t ) 1 (t )- t ( name,payroll)1t (payroll)423G(works) 1- salary (t )21- = 1(t )-t .company -t ( salary)133(t )-t .avg salary first bank.avg salary-first bank( salary)23 into into is exist

7、. is a If a attribute dependents, a attribute a employee, ,ofce,age)books, authors, r)loanempno, date) in a all C H A P T E R3Exercises3.8 this in to “ Smith” “”in “”to participatedrelationrelates *) * participated, participated.driver id=person.driver id = accident.report =participated.report ) par

8、ticipated = =“”driver id in driver id license =“”)11123driver id,)license,model,year) , ,location) driver ,license)participated driver ,car, ) . ,city) , ,salary) ,city) , ) . 3.9 in all First all in live in cities all in live in cities streets allall all First = First all in live in cities e, , c =

9、 e.city=c.city = all in live in cities streets M = = =R.street =R.cityExercises13 allall all T salary salary) S = ) salary)= all salary) ) in all First a all First a allinrelation all First a (the tion salary=salary *1.1 =First all First a salary=salary *1.1 in manages) = First allinrelation = relat

10、ion 143R = (C)S = (F)rR)s)inisto A(r) B=17 r s(r) A,F(C =D(r s) A(r) A r(r) B=17*r B = r s * r,s A,F(C =D(r s) Fr,s C = D R = (C), let r r R. 12inis to r r1 r r21 r r212(r ) 1 (r ) 12 r r12 *r) *r) r r12 this is aExercises15 * r1 ( C)in *r) r r12 r1 ( C) in r) also (r ) 1 (r ) 12 r.A,r.B,r.C r,r2 r.

11、B = r.B in, all is to . S (x all S) (x in S). If a x (x all S) 11=y.x(1ally S 1isaS satisfy x 1inS).Similarly, isa x (x in22S).Ittow toS,(x allS)2 , a sisting all allow toin this salinfo ,salary) , w = in this is to to is “ to ”. to if isreally a to all is less all163 a in a ina a in tot ,balance) )

12、 total(branch tot tot ( tot balance)( , balance) ) total(branch tot ) a ina ,balance) balance)( tot balance)( , balance) ) total(branch tot ) into to 3.4 attribute relation char city char charExercises17 names,streetchar(30),citycity names, ) names, names,salary(8,2), ) names,citycity names, ) names

13、, names, ) to A all A all a A in (if all). employee,ofce,age)books,authors,publisher)loan,isbn,date) in. 183 all , ) , ) to list is also listed, a relation marks , ). to is, all aa into C H A P T E R4SQLExercises4.7 in this a salaried-worker ofce,salary) hourly-wage) street, city) to in in salaried-

14、worker hourly-worker, in a to a this a ) salaried-worker this a is into rela- a salaried-workerrelation (if relation 4.8 a a in 1920 4 4.9 a a list all in relation its ,city),salary) a to a salary,on First avg-salaryvarchar(15) result ; (salary) result = ; avg-salary(”First salary) salary) in 4.6.1

15、city all a call. in ina a to (like to is like Exercises21 in a is a in in to a relation depth , ,depth) attribute directly a a . part ,cost)subpart , id,)A (p ,p , in relation part-id p is a122 part-id p , p 3 p p2112 itself a all part-id “”. a to “”, all its to into a a in if B+. B+ in 7.9 start =B

16、. in F, satisfying B B B D. = D. in F B = D+ R 7.1is a lossless-join (A,B,C)(C,D,E).: a relation r R (r) 1 (r) = r C E r:A B C D Ea1 1 c1 1 1a2 2 c1 2 2= ( C),R = ( E): 12 R(r) 1A B Ca1 1 c1a2 2 c1 R(r) 2C D Ec1 1 1c1 2 2 1(r) 1 (r) 2RA B C D Ea1 1 c1 1 1a1 1 c1 2 2a2 2 c1 1 1a2 2 c1 2 2Clearly,1(r) 1 (r) = r. this is a join.2RExercises A is a collectively, al- to

溫馨提示

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

評論

0/150

提交評論