Sie sind auf Seite 1von 6

University of Sulaimani Final Examination Faculty of Science and Education Sciences School of Science !"##$!"#!

De'artment of Com'uter Science

Subject: Database Management System Class: 4th ear %ime: & hr Examiner: (ooruldeen (asih )adir

)#* +#" Mar,s* Identify the letter of the choice that best completes the statement. (ote: If more than one choice is selected, it is considered as incorrect: #* %he D-./s res'onsibilities should include: .* design 0idely used 'ortions of the external schema -* data availability and recovery from failures C* a only D* a and b E* b only !* 1hich of the follo0ing might be re'resented 0ith a single$valued attribute2 .3 4erson5s 'hone number+s* -3 Car5s color C3 Em'loyee5s educational bac,ground D3 Com'uter5s 'rocessor s'eed &* . table that dis'lays data redundancies yields 66663 .3 inconsistencies -3 anomalies C3 fe0er attributes D3 more entities 4* 1hich of the follo0ing should not be 'laced in a relational table2 .3 Entity -3 .ttribute C3 7elationshi' D3 7e'eating grou' 8* 9n -C(F: every 6666 in a table is a candidate ,ey3 .3 determinant -3 entity C3 'rimary ,ey D3 atomic attribute ;* 1hich of the follo0ing is not an exam'le of denormali<ation2 .3 converting a &(F to !(F

-3 converting a !(F to #(F C3 converting a &(F to #(F D3 converting a &(F to -C(F =* . relation is not in #(F if: .3 it has multi'le candidate ,eys -3 all of the ,ey attributes are defined C3 there are re'eating grou's in the table D3 all attributes are de'endent on the 'rimary ,ey >* . 6666 entity has a 'rimary ,ey that is 'artially derived from the 'arent entity in the relationshi'3 .3 Strong -3 0ea, C3 business D3 relationshi' ?* %he basic S)@ aggregate function that gives the total of all values for a selected attribute in a given column is 66663 .3 CAU(% -3 M9( C3 M.B D3 SUM #"* .ttributes may share a: .3 name -3 domain C3 location D3 table )!* +#" Mar,s* Define briefly follo0ing term:

A. data model: is a collection of conce'ts for describing data.


B. Data inde'endence: applications are insulated from changes in the way the data are structured and stored C. .rtificial Cey: if no obvious key, either stand alone or compound is available, then the last resort is to simply create a key, by assigning a unique number to each record or occurrence. Then this is known as developing an artificial key. D. transaction: is the DB !"s abstract view of a user program, a sequence of reads and writes. #. Seriali<able schedule: a schedule that is equivalent to some serial e$ecution of the transactions.

)&* +#" Mar,s* Consider the scenario from figure +#*: 0here you designed an E7 diagram for a com'any database3 9t builds a 'roduct for art galleries3 %he core of this 'roduct is a database 0ith a schema that ca'tures all the information that galleries need to maintain3 Dalleries ,ee' information about artists: their names +0hich are uniEue*: birth'laces: age: and style of art3 Each grou' is identified by a name +li,e those just given* that describes the grou'3 Finally: galleries ,ee' information about customers3 For each customer: galleries ,ee' that 'erson5s uniEue name: address: total amount of dollars s'ent in the gallery +very im'ortantF*: and the artists and grou's of art that the customer tends to li,e3 1rite S)@ statements to create the corres'onding relations and ca'ture as many of the constraints as 'ossible3

Figure +#* .ns0er: C%#AT# TAB&# &ike'(roup )name C*A%)+,-, cust name C*A%)+,-, .%/ A%0 1#0 )name, cust name-, 23%#/(4 1#0 )name- %#2#%#4C#! (roup, 23%#/(4 1#0 )cust name- %#2#%#4C#! CustomerC%#AT# TAB&# &ike'Artist )name C*A%)+,-, Address C*A%)+,-, Amount 4umber)+,-, Cust'/d 4umber)+,-, .%/ A%0 1#0 )cust'/d-C%#AT# TAB&# (roup )name C*A%)+,-, .%/ A%0 1#0 )name-C%#AT# TAB&# Artist )name C*A%)+,-, birthplace C*A%)+,-, Age DAT#, style C*A%)+,-, .%/ A%0 1#0 )name--

)4* .* +8 Mar,s* for the system crash state the 'hases in the recovery algorithm2 .nd indicate each 'hase briefly2 .ns0er: %here are & 'hases in the recovery algorithm: #3 .nalysis: Scan the log for0ard +from the most recent chec,'oint* to identify all Bacts that 0ere active: and all dirty 'ages in the buffer 'ool at the time of the crash3 !3 7edo: 7edo all u'dates to dirty 'ages in the buffer 'ool: as needed: to ensure that all logged u'dates are in fact carried out and 0ritten to dis,3 +restores the database state to 0hat it 0as at the time of the crash*

&3 Undo: %he 0rites of all Bacts that 0ere active at the crash are undone +by restoring the before value of the u'date: 0hich is in the log record for the u'date*: 0or,ing bac,0ards in the log3 +ma,es sure the database reflects only the actions of committed transactions*

-* +8 Mar,s* select a 'rimary ,ey for relation 7 and u'grade the relation to -C(F3 7 +4atient6no: 4atient6name: .''ointment6no: %ime: Doctor* 4atient6no 4atient 6name 4atient 6no: .''ointment6no %ime: Doctor %ime .''ointment6no .ns0er: 4CG 4atient 6no: .''ointment6no 7 has no re'eating grou' and has 4C: so 7 in #(F Convertion to !(F by removing 'artial de'endency 4atient6no 4atient 6name 7# +4atient6no: .''ointment6no: %ime: Doctor* 7! +4atient6no: 4atient6name* %here is no transitive de'endency: so relations 7# and 7! also in &(F %o convert to -C(F: 0e have to ma,e all determinate a ,ey as the follo0ing: 7& +4atient6no: .''ointment6no: Doctor* 7! +4atient6no: 4atient6name* 74 +.''ointment6no: %ime* )8* .* +4 Mar,s* Consider the follo0ing schema: Su''liers+sid: integer: sname: string: address: string* 4arts+'id: integer: 'name: string: color: string* Catalog+sid: integer: 'id: integer: cost: real*

%he ,ey fields are underlined: and the domain of each field is listed after the field name3 %herefore sid is the ,ey for Su''liers: 'id is the ,ey for 4arts: and sid and 'id together form the ,ey for Catalog3 %he Catalog relation lists the 'rices charged for 'arts by Su''liers3 1rite the follo0ing Eueries in relation algebra: #3 Find the Su''lier names of the su''liers 0ho su''ly a red 'art that costs less than #"" dollars3 !3 Find the Su''lier ids of the su''liers 0ho su''ly a red 'art that costs less than #"" dollars and a green 'art that costs less than #"" dollars3 .ns0er: #$ !$

-* +; Mar,s* Consider the follo0ing relational schema3 .n em'loyee can 0or, in more than one de'artmentH the pct time field of the 1or,s relation sho0s the 'ercentage of time that a given em'loyee 0or,s in a given de'artment3 Em'+eid: integer: ename: string: age: integer: salary: real* 1or,s+eid: integer: did: integer: pct time: integer* De't+did: integer: dname: string: budget: real: managerid: integer* 1rite the follo0ing Eueries in S)@: #$ 4rint the name of each em'loyee 0hose salary exceeds the budget of all of the de'artments that he or she 0or,s in3 !$ Find the enames of managers 0ho manage the de'artments 0ith the largest budgets3 &$ 9f a manager manages more than one de'artment: he or she controls the sum of all the budgets for those de'artments3 Find the managerids of managers 0ho control more than I8 million3 .ns0er: #$

!$

&$

Das könnte Ihnen auch gefallen