2016華南農業大學數據庫考試+答案_第1頁
2016華南農業大學數據庫考試+答案_第2頁
2016華南農業大學數據庫考試+答案_第3頁
已閱讀5頁,還剩5頁未讀 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、 C. BCNFc 3NFC1NF D. 1NF(=BCNF c3NFChoose tlie proper choice to make the following query to realize:Find the names of all customers whose street includes the substring “Main”, select ctistomernarnefrom customerwhere customer_stiet A likeB like MainJC. like MainD. like %MainSVSuppose tlie relation R(

2、A,B,C) has the following four tuples:ABC312412314414Which of the following functional dependencies does not hold iii R?A A-BB BC-AC. C-BD AB-AThe main purpose of transaction 直 nan a gement is to deal witli problem(s).A. Concurrency B. FailureC. Memory crash D both A and BIf and has appeared in the l

3、og after the nearest checkpoint to system crash, then transaction Timust be when system recoveiy.A. undone B. redone C. deleted D. Neither A or BIf a transaction Tx has obtain an shared lock on data item A, then transition Tj cannot A obtam an exclusive lock on data item A B. obtaui a shared lock on

4、 data item B C. obtain an exclusive lock on data item B D obtain an shared lock on data item Ain 2PL protocol, at stage, A transaction may not obtain locks, but can release locks.A. Growing phase B Shrinking phase C. Committed D. AbortedQuestion 3 (13 points) Consider the following database requirem

5、ent A laboratory has properties like ID, name, location, rank A researcher has properties like ID, name, ageB skill A research project has properties like ID,得分name, budget, and year The above three entities must satisfy some constraints Each researcher can be unemployed or employed by one laboratoi

6、y One laboratory can employ many researchers And a researcher can only work at a laboratoiy at a time. If a researcher is employed, his salaiy needs to be recorded in the database A laboratory can participate many projects and a project can be shared by many laboratories得分1) Draw ER diagram to illus

7、trate the requirements. And you can make and state necessary assumptions if any 6 pointsTranslate your ER diagram into relational database schemas, underline primaiy keys of each relation, and label foreign keys if it has. Be sure using different way to mark prunaiy keys and foreign keys 4 pointsv/r

8、ite an sql sentence to create table to store infonnation about which project has been sharedby which labs.【3 pointsQuestion 4. (16 points) Consider the relational database of a banking eiiterpnse with thefollowing relation schemas, where the pnmaiy keys are underlined得分branch (branch_namel branch ci

9、ty, assets)customei* (customer name, customerstreet,customer_city)loan (loan number, branchjiame, amount)boirower (customer name、loan number)account (account number, branch一name, balance) depositor (custonierjiaine、account number)Give an expression in SQL or in relational algebra expression for each

10、 of the following quenes.To find all loan number for loans made at the Penyridge branch (that is the name of a ceitain branch) with loan amounts greater than $1000 in SQL and relational algebra 4 pointsFind all customers v/ho have both a loan and an account using relational algebra expression 3 poin

11、tsFind name of all customers who have at least one loan that the values for amount is null In SQL 3 pointsFind the names of all branches v/here the average account balance is more than $1000 in SQL 3 pointsFind all customers that live in the same city with branches they open accounts in SQL. 3 point

12、s得分Question 5 (11 points) Considei a relation R(A, B, C, D, E) with the set of Functional DependenciesF = A BD.BC D.D A 1Give all candidate keys of R 4 points12)3)Give a canonical cover ofF. 3 points2)3)Is R in 3NF? explain why if it is or decompose it nito 3NF if not 4 points題號二三四五總分得分評閱人訂 題號二三四五總分

13、得分評閱人訂 Question 1: true-false question (30 points) For each of tlie following statements, indicate wlietlier it is TRUE or FALSE (UsuigT for TRUE得分and F for FALSE). You will get 1 point for each correct answer, and 0 point for each wrong or題號123456789101112131415得分TFTTFTTFTFTFFFT題號161718192021222324

14、252627282930得分FTTTFFFTFTFTFTTblank answer. BE SURE TO WRITE YOUR ANSWER IN THE ANSWER SHEET!Question 2 single-choice question (30 points,and 2 for each) BE SURE TO WRITE YOUR ANSWER IN THE ANSWER SHEET!得分題號123456789101112131415得分BCAABDDACDBDBAB華南農業大學期末考試試卷(A卷-Answer Sheets)2015-2016學年第1學期考試科目:Databa

15、se system考試類型:(閉卷)考試時間: 120 分鐘學號 姓名 年級專業 Question 3 (13 points) (ANSWER IN NOT UNIQUE )Draw ER diagram to illustiate the reqiiiiements. And you can make and state necessary assumptions if any. |6 points (next page)Translate your ER diagram into relational database schemas, underline primary keys of

16、each relation, and label foreign keys if it has. Be sure using diffeieut way to mark piimaiy keys and foreign keys. 4 pointsL ab oratory (ID,N am e,Locati on,rank)Research er (ID,Name,birthday, skill,liiretime, salary,lab icf) project (ro, name, budget, year)paiticlpate(proj id. lab id, prqj lab bud

17、get,piqj Jab_year) Here pnmaiy key is underlined, and foreign key is underlined by wavy linewrite an sql sentence to create table to store infonnation about which project has been shared by wliich labs. 3 pointsCreate table paiticipatefproi idiiit,lab id int,proj lab budget real(10,2), prqj_lab_yeai

18、 intprimary key (proj id. lab id), foreign key prqjd reference project(id), foreign key lab id reference laboiatoiy(id)1. ER (Uagram as follows:Question 4. (16 points) Consider the relational database of a banking enterprise with the following relation schemas, where the primary keys are underlined,

19、 branch (blanch name, branch city, assets)customei (customer name,customer street, custonier city) loan (loau number, branch_name,amount)bonower (customer name,1 oaii number) account (accountiiuiibei、branch nanie, balance)depositor (customer name, account nuniber)Give ail expression in SQL oi in rel

20、ational algebra expiessiou for each of the following queries. (ANSWER IN NOT UNIQUE )To find all loan number for loans made at the Penyiidge branch (that is the name of a ceitain branch) with loan amounts gieater than $1000 in SQL and relational algebra. 4 pointsSelect loanjmmber from loan where bra

21、nch_name= Penyridge branch and amount1000II loan_nuinber bxaxKh_ranw=1 Perijiidge branch*andaiuouiit1000 ( loail)g$g$Find all ciistomeis who have both a loan and an account using relational algebra expression. 3 pointsfl customename (borrower XI depositor)Find name of all customers who have at least one loan that the values for amount is null. In SQL 3 pointsSelect distinct customei name fiom loan where amount is nullFind the names of all branches where the average account balance is more than $1000 ill SQL. 3 pointsSe

溫馨提示

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

評論

0/150

提交評論