You are on page 1of 21

Section 12 1. When mapping supertypes, relationships at the supertype level transform as usual.

Relationships at subtype level are implemented as foreign keys, but the foreign key columns all become mandatory. True or False !ark for Revie" #1$ %oints True False #&$ 'orrect 2. Which of the follo"ing are reasons "hy you should consider using a Subtype (mplementation !ark for Revie" #1$ %oints The resulting table "ill reside in a single database and be used by )ust *+, user. When the common access paths for the supertypes are different. -usiness functionality and business rules, access paths and fre.uency of access are all very different bet"een subtypes. #&$ !ost of the relationships are at the supertype level 'orrect /. (t is possible to implement non0transferability via a simple Foreign 1ey Relationship. True or False !ark for Revie" #1$ %oints True False #&$ 'orrect 2. !any to many relationships are implemented via a structure called a3 4444444444444444 !ark for Revie"

#1$ %oints Supertype (ntersection Table #&$ (ntersection ,ntity Subtype (ncorrect. Refer to Section 12 5. ,ntity integrity refers to !ark for Revie" #1$ %oints Tables al"ays containing te6t data Tables al"ays containing numeric data 'olumns having %rimary 1eys, Foreign 1eys, 7ni.ue 1eys and 'heck constraints defined in the database. Tables having %rimary 1eys, Foreign 1eys, 7ni.ue 1eys and 'heck constraints defined in the database. #&$ (ncorrect. Refer to Section 12 8. (f a primary key is a set of columns then one column must be null. True or False !ark for Revie" #1$ %oints True False #&$ 'orrect 9. : table must have a primary key. True or False !ark for Revie" #1$ %oints

True False #&$ 'orrect ;. (dentify all of the incorrect statements that complete this sentence3 : primary key is3 #'hoose three$ !ark for Revie" #1$ %oints #'hoose all correct ans"ers$ : single column that uni.uely identifies each column in a table #&$ *ne or more columns in a table that uni.uely identifies each ro" in that table : set of columns in one table that uni.uely identifies each ro" in another table #&$ *nly one column that must be null #&$ 'orrect <. Why "ould this table name +*T "ork in an *racle database this4year4end=ne6t4year !ark for Revie" #1$ %oints Table names must begin "ith an alphabetic character Too long The %lus sign = is not allo"ed in ob)ect names #&$ +one of the above 'orrect 1>. The transformation from an ,R diagram to a physical design involves changing terminology. %rimary 7ni.ue (dentifiers in the ,R diagram become 4444444444 and relationships become 444444444444. !ark for Revie" #1$ %oints

Foreign keys, %rimary keys %rimary keys, Foreign keys #&$ Foreign keys, mandatory business rules 7ni.ue 1eys, %rimary keys (ncorrect. Refer to Section 12 Section 12 11. (n an *racle database, "hy "ould 14T:-?, not "ork as a table name !ark for Revie" #1$ %oints The database does not understand all capital letters There is no problem here. @ou can create a table called 14T:-?,. *b)ect names must not start "ith a number. They must begin "ith a letter #&$ T:-?, is a reserved "ord 'orrect

Section 1/ 12. What command "ill return data from the database to you !ark for Revie" #1$ %oints F,T'A B,T S,?,'T #&$ R,T7R+

'orrect. 1/. The C,S'R(-, command returns all ro"s from a table. True or False !ark for Revie" #1$ %oints True False #&$ 'orrect.

Section 18 12. Which SD? key"ord specifies that an alias "ill be substituted for a column name in the output of a SD? .uery !ark for Revie" #1$ %oints :S #&$ *R :+C S7-ST(T7T, 'orrect. 15. (n a SD? statement, "hich clause specifies one or more columns to be returned by the .uery !ark for Revie" #1$ %oints S,?,'T #&$ FR*! WA,R,

:ny of the above options, you can list columns "herever you "ant to in a S,?,'T statement. 'orrect. 18. The S,?,'T statement retrieves information from the database. (n a S,?,'T statement, you can do all of the follo"ing ,E',%T3 !ark for Revie" #1$ %oints %ro)ection !anipulation #&$ Foining Selection 'orrect. 19. When you use the S,?,'T clause to list one or t"o columns only from a table and no WA,R, clause, "hich SD? capability is used !ark for Revie" #1$ %oints Foining only Selection only %ro)ection only #&$ %ro)ection and Selection 'orrect. 1;. @ou .uery the database "ith this SD? statement3 S,?,'T & FR*! transaction WA,R, product4id G 258<H Which SD? S,?,'T statement capabilities are achieved "hen this statement is e6ecuted

!ark for Revie" #1$ %oints Selection only #&$ %ro)ection only Selection and pro)ection only %ro)ection, selection and )oining 'orrect. 1<. Which SD? statement "ill return an error !ark for Revie" #1$ %oints S,? & FR skyH #&$ select star from skyH S,?,'T star FR*! skyH S,?,'T & FR*! skyH (ncorrect. See Section 18 2>. (n a S,?,'T clause, "hat is the result of 2 = / & 2 !ark for Revie" #1$ %oints 8 ; #&$ 1> 1/ 'orrect. Section 18

21. Would it be a good idea to model age as an attribute of ST7C,+T !ark for Revie" #1$ %oints @es !aybe it could stop us having to calculate someoneIs age every time "e need it Sometimes +o 0 it breaks the +ormaliJation rules #&$ 'orrect 22. :ny +on07(C must be dependant on the entire 7(C. True or False !ark for Revie" #1$ %oints True #&$ False 'orrect

Section 19 2/. @ou need to display all the employees "hose last name starts "ith the letters Sm . Which WA,R, clause should you use !ark for Revie" #1$ %oints WA,R, last4name ?(1, ISmKI #&$ WA,R, last4name ?(1, IKSmI WA,R, last4name ?(1, I4SmI WA,R, last4name ?(1, ISm4I (ncorrect. See Section 19

22. @ou "ant to retrieve a list of customers "hose last names begin "ith the letters Fr . Which symbol should you include in the WA,R, clause of your S,?,'T statement to achieve the desired result !ark for Revie" #1$ %oints K #&$ L M & 'orrect. See Section 19 25. (f the ,!%?*@,,S table has the follo"ing columns, and you "ant to "rite a S,?,'T statement to return the employee last name and department number for employee number 198, "hich of the follo"ing SD? statements should you use +ame Type ?ength ,!%?*@,,4(C +7!-,R 22 F(RST4+:!, N:R'A:R2 2> ?:ST4+:!, N:R'A:R2 25 ,!:(? N:R'A:R2 25 %A*+,4+7!-,R N:R'A:R2 2> S:?:R@ +7!-,R 22 '*!!(SS(*+4%'T +7!-,R 22 !:+:B,R4(C +7!-,R 22 C,%:RT!,+T4(C +7!-,R 22 !ark for Revie" #1$ %oints S,?,'T last4name, department4id FR*! employees WA,R, employee4id G 198H #&$ S,?,'T last4name, department4id FR*! employees WA,R, employee4id e.uals 198H

S,?,'T first4name, employee4id FR*! employees WA,R, employee4id G 198H S,?,'T last4name, employee4id FR*! employees WA,R, employee4id e.uals 198H

'orrect. 28. @ou need to display all the values in the ,!:(? column that contains the underscore #4$ character as part of that email address. The WA,R, clause in your S,?,'T statement contains the ?(1, operator. What must you include in the ?(1, operator !ark for Revie" #1$ %oints The ,S':%, option #O$ and one or more percent signs #K$ The #=$ operator : percent sign #K$ The ,S':%, option #O$ #&$ 'orrect. See Section 19 29. ,valuate this S,?,'T statement3 S,?,'T last4name, first4name, salary FR*! employeesH Ao" "ill the heading for the S:?:R@ column appear in the display by default in *racle :pplication ,6press !ark for Revie" #1$ %oints The heading "ill display "ith the first character capitaliJed and centered. The heading "ill display "ith the first character capitaliJed and left )ustified.

The heading "ill display as uppercase and centered. #&$ The heading "ill display as uppercase and left )ustified. 'orrect. 2;. Which operator is used to combine columns of character strings to other columns !ark for Revie" #1$ %oints & P = QQ #&$ 'orrect. See Section 19 2<. Which comparison condition "ould you use to select ro"s that match a character pattern !ark for Revie" #1$ %oints (+ ?(1, #&$ :?!*ST S(!(?:R 'orrect. />. Which statement best describes ho" column headings are displayed by default in *racle :pplication ,6press3 !ark for Revie" #1$ %oints 'olumn headings are displayed left0)ustified and in lo"ercase.

'olumn headings are displayed left0)ustified and in uppercase. 'olumn headings are displayed centered and in uppercase. #&$ 'olumn headings are displayed centered and in mi6ed case. 'orrect. See Section 19 Section 19 /1. @ou need to display only uni.ue combinations of the ?:ST4+:!, and !:+:B,R4(C columns in the ,!%?*@,,S table. Which key"ord should you include in the S,?,'T clause !ark for Revie" #1$ %oints *+?@ 7+(D7, C(ST(+'T #&$ C(ST(+'TR*W 'orrect. See Section 19 /2. Which symbol represents the not e.ual to condition !ark for Revie" #1$ %oints M I=I RG #&$ L (ncorrect. See Section 19. //. The 'oncatenation *perator does "hich of the follo"ing !ark for Revie" #1$ %oints

?inks ro"s of data together inside the database. ?inks t"o or more columns or literals to form a single output column #&$ (s represented by the asterisk #&$ symbol Separates columns. 'orrect. See Section 19 /2. The %R*C7'T table contains these columns3 %R*C7'T4(C +7!-,R#<$ C,S'R(%T(*+ N:R'A:R2#2>$ '*ST +7!-,R#5,2$ ?*':T(*+4(C N:R'A:R2#1>$ @ou "ant to display product costs "ith these desired results3 1. The cost displayed for each product is increased by 1> percent. 2. The product location id must be 2;5<, <9;<, or <;<;. /. Ten percent of the original cost is less than S1>. Which statement should you issue !ark for Revie" #1$ %oints S,?,'T product4id, cost & 1.1> FR*! product WA,R, cost & .1> T 1>.>> :+C location4id (+ #2;5<, <9;<, <;<;$H #&$ S,?,'T product4id, cost & .1> FR*! product WA,R, cost & 1.1> U 1>.>> :+C location4id (+ #2;5<, <9;<, <;<;$H S,?,'T product4id, cost & 1.1> FR*! product WA,R, cost & 1.1> T 1>.>> :+C location4id G #2;5<, <9;<, <;<;$H S,?,'T product4id, cost & 1.1>

FR*! product WA,R, cost & .1> U 1>.>> :+C location4id G #2;5<, <9;<, <;<;$H

'orrect. See Section 19 /5. (f you "rite .ueries using the -,TW,,+ operator it does not matter in "hat order you enter the values, i.e. -,TW,,+ lo" value :+C high value "ill give the same result as -,TW,,+ high value and lo" value. True or False !ark for Revie" #1$ %oints True False #&$ 'orrect. /8. The ,!%?*@,,S table contains these columns3 ,!%?*@,,4(C +7!-,R#<$ %rimary1ey ?:ST4+:!, N:R'A:R2 #2>$ F(RST4+:!, N:R'A:R2 #2>$ C,%:RT!,+T4(C +7!-,R#5$ +*T +7?? !:+:B,R4(C +7!-,R#<$ +*T +7?? ,valuate these t"o S,?,'T statements3 1. S,?,'T C(ST(+'T employee4id, department4id, manager4id FR*! employeesH 2. S,?,'T employee4id, department4id, manager4id FR*! employeesH Which of the follo"ing statements is true !ark for Revie" #1$ %oints The t"o statements "ill display the same data. #&$ The first statement "ill display a particular C,%:RT!,+T4(C only once. The first statement "ill +*T display values from all of the ro"s in the ,!%?*@,,S table The second statement could display a uni.ue combination of the ,!%?*@,,4(C, !:+:B,R4(C, and C,%:RT!,+T4(C values more than once.

'orrect. See Section 19

Section 1; /9. Which logical operator returns TR7, if either condition is true !ark for Revie" #1$ %oints *R #&$ :+C +*T -*TA 'orrect. /;. Which clause "ould you include in a S,?,'T statement to sort the ro"s returned by the ?:ST4+:!, column !ark for Revie" #1$ %oints *RC,R -@ #&$ WA,R, FR*! A:N(+B 'orrect. /<. Which statement about the logical operators is true !ark for Revie" #1$ %oints The order of operator precedence is :+C, *R, and +*T. The order of operator precedence is :+C, +*T, and *R.

The order of operator precedence is +*T, *R, and :+C. The order of operator precedence is +*T, :+C, and *R. #&$ 'orrect. 2>. The *RC,R -@ clause al"ays comes last. True or False !ark for Revie" #1$ %oints True #&$ False 'orrect. Section 1; 21. Which of the follo"ing is TR7, regarding the logical :+C operator !ark for Revie" #1$ %oints TR7, :+C TR7, return F:?S, TR7, :+C F:?S, return TR7, F:?S, :+C TR7, return +7?? TR7, :+C F:?S, return F:?S, #&$ 'orrect. 22. Which statement about the *RC,R -@ clause is true !ark for Revie" #1$ %oints @ou can use a column alias in the *RC,R -@ clause. #&$ The default sort order of the *RC,R -@ clause is descending. The *RC,R -@ clause can only contain columns that are included in the S,?,'T list.

The *RC,R -@ clause should immediately precede the FR*! clause in a S,?,'T statement 'orrect. 2/. The %?:@,RS table contains these columns3 %?:@,RS T:-?,3 ?:ST4+:!, N:R'A:R2 #2>$ F(RST4+:!, N:R'A:R2 #2>$ S:?:R@ +7!-,R#;,2$ T,:!4(C +7!-,R#2$ !:+:B,R4(C +7!-,R#<$ %*S(T(*+4(C +7!-,R#2$ @ou "ant to display all playersI names "ith position 8<>> or greater. @ou "ant the players names to be displayed alphabetically by last name and then by first name. Which statement should you use to achieve the re.uired results !ark for Revie" #1$ %oints S,?,'T last4name, first4name FR*! players WA,R, position4id UG 8<>> *RC,R -@ last4name, first4nameH #&$ S,?,'T last4name, first4name FR*! players WA,R, position4id U 8<>> *RC,R -@ last4name, first4nameH S,?,'T last4name, first4name FR*! players WA,R, position4id TG 8<>> *RC,R -@ last4name, first4nameH S,?,'T last4name, first4name FR*! players WA,R, position4id UG 8<>> *RC,R -@ last4name C,S', first4nameH

'orrect. 22. ,valuate this SD? statement3 S,?,'T e.employee4id, e.last4name, e.first4name, m.manager4id FR*! employees e, employees m *RC,R -@ e.last4name, e.first4name WA,R, e.employee4id G m.manager4idH This statement fails "hen e6ecuted. Which change "ill correct the problem !ark for Revie" #1$ %oints Reorder the clauses in the .uery. #&$ Remove the table aliases in the WA,R, clause. Remove the table aliases in the *RC,R -@ clause. (nclude a A:N(+B clause. 'orrect. 25. ,valuate this S,?,'T statement3 S,?,'T last4name, first4name, salary FR*! employeesH Ao" "ill the results of this .uery be sorted !ark for Revie" #1$ %oints The database "ill display the ro"s in "hatever order it finds it in the database, so no particular order. #&$ The results "ill be sorted ascending by the ?:ST4+:!, column only. The results "ill be sorted ascending by ?:ST4+:!, and F(RST4+:!, only. The results "ill be sorted ascending by ?:ST4+:!,, F(RST4+:!,, and S:?:R@. 'orrect.

28. ,valuate this S,?,'T statement3 S,?,'T last4name, first4name, email FR*! employees *RC,R -@ emailH (f the ,!:(? column contains null values, "hich statement is true !ark for Revie" #1$ %oints +ull email values "ill be displayed first in the result. +ull email values "ill be displayed last in the result. #&$ +ull email values "ill not be displayed in the result. The result "ill not be sorted. 'orrect. 29. ,valuate this S,?,'T statement3 S,?,'T & FR*! employees WA,R, department4id G /2 *R department4id G 25 *R department4id G 89H Which operator is the e.uivalent of the *R conditions used in this S,?,'T statement !ark for Revie" #1$ %oints (+ #&$ :+C ?(1, -,TW,,+ ... :+C ... 'orrect.

2;. @ou .uery the database "ith this SD? statement3 S,?,'T price FR*! products WA,R, price (+#1, 25, 5>, 25>$ :+C #price -,TW,,+ 25 :+C 2> *R price U 5>$H Which t"o values could the statement return #'hoose t"o.$ !ark for Revie" #1$ %oints #'hoose all correct ans"ers$ 1 5> 25 #&$ 1> 25> #&$ 1>> 'orrect. 2<. ,valuate this SD? statement3 S,?,'T product4id, product4name, price FR*! products *RC,R -@ product4name, priceH What occurs "hen the statement is e6ecuted !ark for Revie" #1$ %oints The results are sorted numerically only. The results are sorted alphabetically only. The results are sorted numerically and then alphabetically. The results are sorted alphabetically and then numerically. #&$

'orrect. 5>. Which S,?,'T statement should you use to limit the display of product information to those products "ith a price of less than 5> !ark for Revie" #1$ %oints S,?,'T product4id, product4name FR*! products WA,R, price T 5>H #&$ S,?,'T product4id, product4name FR*! products A:N(+B price T 5>H S,?,'T product4id, product4name FR*! products WA,R, price TG 5>H S,?,'T product4id, product4name FR*! products BR*7% -@ price T 5>H S,?,'T product4id, product4name FR*! products WA,R, price T 5>.>> BR*7% -@ priceH

'orrect.

You might also like