final ex s2 p2
-
Upload
kasa-ferenc -
Category
Documents
-
view
216 -
download
0
description
Transcript of final ex s2 p2
7/17/2019 final ex s2 p2
http://slidepdf.com/reader/full/final-ex-s2-p2 1/16
Test: Final Exam Semester 2 Part 2
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.
Section 11
(Answer all questions in this section)
1. You can create a view if the view subquery contains an inline view. True orFalse
!ark for
Review
(") #oints
True (*)
False
$orrect
2. %hich o&tion would you use when creatin' a view to ensure that no !o&erations occur on the view
!ark for
Review
(") #oints
FR$+
FR$+
%-T R+A Y (*)
%-T A!- #T-
$orrect
3. Your /ana'er has 0ust asked you to create a re&ort that illustrates the salaryran'e of all the e/&loyees at your co/&any. %hich of the followin' 12state/ents will create a view called 1AARY345 based on the e/&loyee lastna/es, de&art/ent na/es, salaries, and salary 'rades for all e/&loyees5se the +!#Y++1, +#ART!+T1, and 6738RA+1 tables. abel thecolu/ns +/&loyee, e&art/ent, 1alary, and 8rade, res&ectively.
!ark for
Review
(") #oints
$R+AT+ R R+#A$+ 4-+% salary3vuA1 1++$T e.last3na/e 9+/&loyee9, d.de&art/ent3na/e 9e&art/ent9,e.salary 91alary9, 0. 'rade3level 98rade9FR! e/&loyees e, de&art/ents d, 0ob3'rades 0%+R+ e.de&art/ent3id equals d.de&art/ent3id A e.salary
7+T%++ 0.lowest3sal and 0.hi'hest3sal:$R+AT+ R R+#A$+ 4-+% salary3vuA1 1++$T e.e/&id 9+/&loyee9, d.de&art/ent3na/e 9e&art/ent9,e.salary 91alary9, 0. 'rade3level 98rade9FR! e/&loyees e, de&art/ents d, 0ob3'rades 0%+R+ e.de&art/ent3id ; d.de&art/ent3id T e.salary 7+T%++ 0.lowest3sal and 0.hi'hest3sal:$R+AT+ R R+#A$+ 4-+% salary3vuA1 1++$T e.last3na/e 9+/&loyee9, d.de&art/ent3na/e 9e&art/ent9,e.salary 91alary9, 0. 'rade3level 98rade9
7/17/2019 final ex s2 p2
http://slidepdf.com/reader/full/final-ex-s2-p2 2/16
FR! e/&loyees e, de&art/ents d, 0ob3'rades 0%+R+ e.de&art/ent3id ; d.de&art/ent3id A e.salary 7+T%++ 0.lowest3sal and 0.hi'hest3sal:
(*)
$R+AT+ R R+#A$+ 4-+% salary3vuA1 (1++$T e.last3na/e 9+/&loyee9, d.de&art/ent3na/e9e&art/ent9, e.salary 91alary9, 0. 'rade3level 98rade9FR! e/&loyees e/&, de&art/ents d, 0ob 'rades 0%+R+ e.de&art/ent3id ; d.de&art/ent3id A e.salary 7+T%++ 0.lowest3sal and 0.hi'hest3sal):
$orrect
4. %hich state/ent about &erfor/in' ! o&erations on a view is true !ark for
Review
(") #oints
You can delete data in a view if the view contains the -1T-$Tkeyword. You cannot /odify data in a view if the view contains a %+R+ clause.
You cannot /odify data in a view if the view contains a 'rou& function.(*) You can /odify data in a view if the view contains a 8R5# 7Y clause.
$orrect
5. %hich of the followin' is TR5+ re'ardin' si/&le views !ark for
Review
(") #oints
1i/&le views retrieve data fro/ /any tables, so they ty&ically contain 0oins.1i/&le views contain functions or 'rou&s of data.
1i/&le views can be used to &erfor/ ! o&erations. (*)
1i/&le views are not stored in the ata ictionary.
$orrect
6. You create a view on the +!#Y++1 and +#ART!+T1 tables to dis&laysalary infor/ation &er de&art/ent.%hat will ha&&en if you issue the followin' state/ent
$R+AT+ R R+#A$+ 4-+% sal3de&tA1 1++$T 15!(e.salary) sal, d.de&art/ent3na/eFR! e/&loyees e, de&art/ents d%+R+ e.de&art/ent3id ; d.de&art/ent3id8R5# 7Y d.de&art/ent3na/e
!ark for
Review
(") #oints
7/17/2019 final ex s2 p2
http://slidepdf.com/reader/full/final-ex-s2-p2 3/16
R+R 7Y d.de&art/ent3na/e:
A co/&le< view is created that returns the su/ of salaries &erde&art/ent, sorted by de&art/ent na/e. (*)
A si/&le view is created that returns the su/ of salaries &erde&art/ent, sorted by de&art/ent na/e.A co/&le< view is created that returns the su/ of salaries &erde&art/ent, sorted by de&art/ent id.othin', as the state/ent contains an error and will fail.
$orrect
7. %hich state/ent about &erfor/in' ! o&erations on a view is true !ark for
Review
(") #oints
You can &erfor/ ! o&erations on si/&le views. (*)
You cannot &erfor/ ! o&erations on a view that contains the %-T$+$= #T- clause. You can &erfor/ ! o&erations on a view that contains the %-T R+AY o&tion. You can &erfor/ ! o&erations on a view that contains colu/nsde>ned by e<&ressions, such as $1T ? ".
$orrect
8. %hich of the followin' describes a to&@ query !ark for
Review
(") #oints
A to&@ query returns the botto/ " records fro/ the s&eci>ed table.
A to&@ query returns the to& " records fro/ the s&eci>ed table.
A to&@ query returns a result set that is sorted accordin' to thes&eci>ed colu/n values.A to&@ query returns a li/ited result set, returnin' data based onhi'hest or lowest criteria. (*)
$orrect
9. An inline view is an unna/ed select state/ent foundB
!ark for
Review
(") #oints
-n the user3views data dictionary view.
-n a s&ecial database colu/n of a users table.
7/17/2019 final ex s2 p2
http://slidepdf.com/reader/full/final-ex-s2-p2 4/16
+nclosed in &arentheses within the select list of a surroundin' query.
+nclosed in &arentheses within the FR! clause of a surroundin' query.(*)
$orrect
10. You want to create a view based on the 1A+1R+# table. You &lan to 'rantaccess to this view to /e/bers of the 1ales de&art/ent. You want 1alese/&loyees to be able to u&date the 1A+1R+# table throu'h the view, whichyou &lan to na/e 1A+1R+#34-+%. %hat should not be s&eci>ed in your$R+AT+ 4-+% state/ent
!ark for
Review
(") #oints
The A1 keyword
A %+R+ clause
The - keyword
A 8R5# 7Y clause (*)
$orrectSection 11
(Answer all questions in this section)
11. +valuate this $R+AT+ 4-+% state/entB
$R+AT+ 4-+% sales3viewA1 1++$T custo/er3id, re'ion, 15!(sales3a/ount)FR! sales%+R+ re'ion - ("C, DC, EC, C)8R5# 7Y re'ion, custo/er3id:
%hich state/ent is true
!ark for
Review (") #oints
You can /odify data in the 1A+1 table usin' the 1A+134-+% view.
You cannot /odify data in the 1A+1 table usin' the 1A+134-+% view.(*) You can only insert records into the 1A+1 table usin' the 1A+134-+%view. The $R+AT+ 4-+% state/ent 'enerates an error.
$orrect
12. The +!#3-1T34 view is no lon'er needed. %hich state/ent should you use
to the re/ove this view
!ark for
Review (") #oints
R# e/&3hist3v:
++T+ e/&3hist3v:
R+!4+ e/&3hist3v:
7/17/2019 final ex s2 p2
http://slidepdf.com/reader/full/final-ex-s2-p2 5/16
R# 4-+% e/&3hist3v: (*)
$orrect
13. %hich o&tion would you use to /odify a view rather than dro&&in' it andrecreatin' it
!ark for
Review (") #oints
FR$+
FR$+
$R+AT+ R R+#A$+ (*)
%-T A!- #T-
$orrect
14. %hich state/ent about the $R+AT+ 4-+% state/ent is true !ark for
Review (") #oints
A $R+AT+ 4-+% state/ent $A contain a 0oin query. (*)
A $R+AT+ 4-+% state/ent $AT contain an R+R 7Y clause.
A $R+AT+ 4-+% state/ent $AT contain a function.
A $R+AT+ 4-+% state/ent $AT contain a 8R5# 7Y clause.
$orrect
15. You need to create a view on the 1A+1 table, but the 1A+1 table has notyet been created. %hich state/ent is true
!ark for
Review (") #oints
You /ust create the 1A+1 table before creatin' the view.
7y default, the view will be created even if the 1A+1 table does note<ist. You can create the table and the view at the sa/e ti/e usin' theFR$+ o&tion.
You can use the FR$+ o&tion to create the view before the 1A+1 tablehas been created. (*)
$orrect
16. +valuate this $R+AT+ 4-+% state/entB
$R+AT+ 4-+% e/&3viewA1 1++$T 15!(salary)
!ark for
Review
7/17/2019 final ex s2 p2
http://slidepdf.com/reader/full/final-ex-s2-p2 6/16
FR! e/&loyees:
%hich state/ent is true
(") #oints
You cannot u&date data in the +!#Y++1 table usin' the +!#34-+%view. (*) You can u&date any data in the +!#Y++1 table usin' the +!#34-+%view. You can delete records fro/ the +!#Y++1 table usin' the +!#34-+%view. You can u&date only the 1AARY colu/n in the +!#Y++1 table usin'the +!#34-+% view.
$orrect
17. -n order to query a database usin' a view, which of the followin' state/entsa&&lies
!ark for
Review (") #oints
5se s&ecial 4-+% 1++$T keywords.
You can retrieve data fro/ a view as you would fro/ any table. (*)
You can never see all the rows in the table throu'h the view.
The tables you are selectin' fro/ can be e/&ty, yet the view stillreturns the ori'inal data fro/ those tables.
-ncorrect. Refer to 1ection "" esson ".
18.%hich of the followin' keywords cannot be used when creatin' a view !ark for
Review (") #oints
A4-8
%+R+
R+R 7Y (*)
They are all valid keywords when creatin' views.
-ncorrect. Refer to 1ection "" esson ".
19. You ad/inister an racle database which contains a table na/ed+!#Y++1. uke, a database user, /ust create a re&ort that includes thena/es and addresses of all e/&loyees. You do not want to 'rant ukeaccess to the +!#Y++1 table because it contains sensitive data. %hich ofthe followin' actions should you &erfor/ >rst
!ark for
Review (") #oints
$reate a re&ort for hi/.
7/17/2019 final ex s2 p2
http://slidepdf.com/reader/full/final-ex-s2-p2 7/16
$reate a view. (*)
$reate a subquery.
$reate an inde<.
$orrect
Section 12
(Answer all questions in this section)
20. %hich of the followin' best describes the function of an inde< !ark for
Review (") #oints
An inde< can increase the &erfor/ance of 12 queries that search lar'etables. (*)An inde< can reduce the ti/e required to 'rant /ulti&le &rivile'es tousers.An inde< can run state/ent blocks when ! actions occur a'ainst atable.An inde< can &revent users fro/ viewin' certain data in a table.
$orrect
Section 12
(Answer all questions in this section)
21.%hich state/ent about an inde< is true !ark for
Review (") #oints
An inde< can only be created on a sin'le table colu/n.
$reatin' an inde< will always i/&rove query &erfor/ance.
$reatin' an inde< reorders the data in the underlyin' table.
An inde< created on /ulti&le colu/ns is called a co/&osite orconcatenated inde<. (*)
$orrect
22. You need to deter/ine the table na/e and colu/n na/e(s) on which the1A+13-G inde< is de>ned. %hich data dictionary view would you query
!ark for
Review (") #oints
51+R3-+G+1
7/17/2019 final ex s2 p2
http://slidepdf.com/reader/full/final-ex-s2-p2 8/16
51+R3TA7+1
51+R376+$T1
51+R3-3$5!1 (*)
$orrect
23. %hen creatin' an inde< on one or /ore colu/ns of a table, which of thefollowin' state/ents are true($hoose two)
!ark for
Review (") #oints
($hoose all correct answers)
You should create an inde< if the table is lar'e and /ost queries aree<&ected to retrieve less than D to &ercent of the rows. (*) You should always create an inde< on tables that are frequentlyu&dated.
You should create an inde< if one or /ore colu/ns are frequently usedto'ether in a 0oin condition. (*) You should create an inde< if the table is very s/all.
$orrect
24. 5ser !aryHs sche/a contains an +!# table. !ary has atabaseAd/inistrator &rivile'es and e<ecutes the followin' state/entB
$R+AT+ #57-$ 1YY! e/& FR /ary.e/&:
5ser 1usan now needs to 1++$T fro/ !aryHs +!# table. %hich of thefollowin' 12 state/ents can she use ($hoose two)
!ark for
Review (") #oints
($hoose all correct answers)
$R+AT+ 1YY! /arys3e/& FR /ary(e/&):
1++$T * FR! e/&: (*)
1++$T * FR! e/&./ary:
1++$T * FR! /ary.e/&: (*)
$orrect
25. You issue this state/entB
AT+R 1+25+$+ &o3sequence -$R+!+T 7Y D:
%hich state/ent is true
!ark for
Review (") #oints
1equence nu/bers will be cached.
7/17/2019 final ex s2 p2
http://slidepdf.com/reader/full/final-ex-s2-p2 9/16
Future sequence nu/bers 'enerated will increase by D each ti/e anu/ber is 'enerated. (*)-f the #31+25+$+ sequence does not e<ist, it will be created.
The state/ent fails if the current value of the sequence is 'reater thanthe 1TART %-T value.
$orrect
26. +valuate this $R+AT+ 1+25+$+ state/entB
$R+AT+ 1+25+$+ order3id3seq $Y$+ $A$+:
%hich state/ent is true
!ark for
Review (") #oints
The sequence has no /a<i/u/ value.
The sequence &reallocates values and retains the/ in /e/ory.
The sequence will continue to 'enerate values after reachin' its
/a<i/u/ value. The sequence will start with ". (*)
$orrect
Section 13
(Answer all questions in this section)
27. 33333333333333333 are s&ecial characters that have a s&ecial /eanin', suchas a wildcard character, a re&eatin' character, a non@/atchin' character, or
a ran'e of characters. You can use several of these sy/bols in &attern/atchin'.
!ark for
Review (") #oints
$li& Art
!eta characters (*)
Al&hanu/eric values
Reference checks
$orrect
28. Re'ular e<&ressions are a /ethod of describin' both si/&le and co/&le<&atterns for searchin' and /ani&ulatin'. True or False
!ark for
Review (") #oints
True (*)
False
7/17/2019 final ex s2 p2
http://slidepdf.com/reader/full/final-ex-s2-p2 10/16
$orrect
29. %hich of these 12 functions used to /ani&ulate strin's is T a validre'ular e<&ression function
!ark for
Review (") #oints
R+8+G#3R+#A$+
R+8+G#3-=+
R+8+G# (*)
R+8+G#31571TR
$orrect
30. 5ser =ate wants to create inde<es on tables in her sche/a. %hat &rivile'e
/ust be 'ranted to =ate so that she can do this
!ark for
Review (") #oints
$R+AT+ -+G
$R+AT+ AY -+G
AT+R TA7+
one: users do not need e<tra &rivile'es to create inde<es on tables intheir own sche/a. (*)
$orrect
Section 13
(Answer all questions in this section)
31. You want to 'rant &rivile'es to user $A that will allow $A to u&datethe data in the +!#Y++1 table. %hich ty&e of &rivile'es will you 'rant to$A
!ark for
Review (") #oints
5ser &rivile'es
b0ect &rivile'es (*)
1yste/ &rivile'es
Ad/inistrator &rivile'es
$orrect
32. You are the database ad/inistrator. You want to create a new user 6+1with a &assword of !AR=, and allow this user to create his own tables.
!ark for
7/17/2019 final ex s2 p2
http://slidepdf.com/reader/full/final-ex-s2-p2 11/16
%hich of the followin' should you e<ecute Review (") #oints
$R+AT+ 51+R 0ones -+T-F-+ 7Y /ark:8RAT $R+AT+ TA7+ T 0ones:$R+AT+ 51+R 0ones -+T-F-+ 7Y /ark:8RAT $R+AT+ 1+11- T 0ones:
8RAT $R+AT+ TA7+ T 0ones:
(*)
8RAT $R+AT+ 1+11- T 0ones:8RAT $R+AT+ TA7+ T 0ones:$R+AT+ 51+R 0ones -+T-F-+ 7Y /ark:8RAT $R+AT+ 1+11- T 0ones:
-ncorrect. Refer to 1ection "E esson ".
33. 5ser AA! has successfully lo''ed on to the database in the &ast, buttoday he receives an error /essa'e statin' that (althou'h he has entered
his &assword correctly) he cannot lo' on. %hat is the /ost likely cause ofthe &roble/
!ark for
Review (") #oints
ne or /ore ob0ect &rivile'es have been R+4=+d fro/ Ada/.
AA!Hs $R+AT+ 1+11- &rivile'e has been revoked. (*)
AA!Hs $R+AT+ 51+R &rivile'e has been revoked.
AA!Hs user account has been re/oved fro/ the database.
$orrect
34. %hich of the followin' are syste/ &rivile'es($hoose two)
!ark for
Review (") #oints
($hoose all correct answers)
$R+AT+ TA7+ (*)
5#AT+
$R+AT+ 1YY! (*)
-+G
$orrect
35. 5ser 77Hs sche/a contains an +!#Y++1 table. 77 e<ecutes thefollowin' state/entB
8RAT 1++$T e/&loyees T /ary %-T 8RAT #T-:
!ark for
Review (") #oints
7/17/2019 final ex s2 p2
http://slidepdf.com/reader/full/final-ex-s2-p2 12/16
%hich of the followin' state/ents can !ARY now e<ecute successfully($hoose two)
($hoose all correct answers)
1++$T FR! bob.e/&loyees: (*)
R+4=+ 1++$T bob.e/&loyees FR! bob:
8RAT 1++$T bob.e/&loyees T #57-$: (*)
R# TA7+ bob.e/&loyees:
$orrect
36. %hich of the followin' si/&li>es the ad/inistration of &rivile'es !ark for
Review (") #oints
An inde<
A view
A tri''er
A role (*)
$orrect
37. %hen 'rantin' an ob0ect &rivile'e, which o&tion would you include to allowthe 'rantee to 'rant the &rivile'e to another user !ark for
Review (") #oints
%-T 8RAT #T- (*)
%-T A!- #T-
#57-$
FR$+
$orrect
38. 8rantin' an ob0ect &rivile'e %-T 8RAT #T- allows the reci&ient to'rant all ob0ect &rivile'es on the table to other users. True or False
!ark for
Review (") #oints
True
7/17/2019 final ex s2 p2
http://slidepdf.com/reader/full/final-ex-s2-p2 13/16
False (*)
$orrect
39. %hich of the followin' best describes the &ur&ose of the R+F+R+$+1ob0ect &rivile'e on a table
!ark for
Review (") #oints
-t allows a userHs session to read fro/ the table but only so that forei'nkey constraints can be checked.-t allows a user to refer to the table in a 1++$T state/ent.
-t allows a user to create forei'n key constraints on the table. (*)
-t allows the user to create new tables which contain the sa/e data asthe referenced table.
-ncorrect. Refer to 1ection "E esson D.
40. You need to 'rant user 77 1++$T &rivile'es on the +!#Y++1 table. Youwant to allow 77 to 'rant this &rivile'es to other users. %hich state/entshould you use
!ark for
Review (") #oints
8RAT 1++$T e/&loyees T bob %-T 8RAT #T-: (*)
8RAT 1++$T e/&loyees T #57-$ %-T 8RAT #T-:
8RAT 1++$T e/&loyees T bob:
8RAT 1++$T e/&loyees T bob %-T A!- #T-:
$orrect
Section 14
(Answer all questions in this section)
41. %hich 12 state/ent is used to re/ove all the chan'es /ade by anunco//itted transaction
!ark for
Review (") #oints
5:
R7A$=: (*)
R7A$= T 1A4+#-T:
R+4=+ ナ:
$orrect
7/17/2019 final ex s2 p2
http://slidepdf.com/reader/full/final-ex-s2-p2 14/16
42. 5ser 77Hs $51T!+R1 table contains DC rows. 77 inserts two /ore rowsinto the table but does not $!!-T his chan'es. 5ser 6A+ now e<ecutesB
1++$T $5T(*) FR! bob.custo/ers:
%hat result will 6A+ see
!ark for
Review (") #oints
DD
DC (*)
D
6A+ will receive an error /essa'e because she is not allowed to querythe table while 77 is u&datin' it.
$orrect
Section 15
(Answer all questions in this section)
43. The +!#Y++3- colu/n in the +!#Y++1 table corres&onds to the+!#Y++3- colu/n of the R+R1 table. The +!#Y++3- colu/n in the R+R1 table contains null values for rowsthat you need to dis&lay.%hich ty&e of 0oin should you use to dis&lay the data
!ark for
Review (") #oints
atural 0oin
1elf@0oin
uter 0oin (*)+qui0oin
$orrect
44. +valuate this 1++$T state/entB
1++$T &.&layer3id, /.last3na/e, /.>rst3na/e, t.tea/3na/eFR! &layer &+FT 5T+R 6- &layer / (&./ana'er3id ; /.&layer3id)+FT 5T+R 6- tea/ t (&.tea/3id ; t.tea/3id):
%hich 0oin is evaluated >rst
!ark for
Review (") #oints
The self@0oin of the &layer table (*)
The 0oin between the &layer table and the tea/ table on T+A!3-
The 0oin between the &layer table and the tea/ table on !AA8+R3-
The 0oin between the &layer table and the tea/ table on #AY+R3-
7/17/2019 final ex s2 p2
http://slidepdf.com/reader/full/final-ex-s2-p2 15/16
$orrect
45. %hat is the /ini/u/ nu/ber of 0oin conditions required to 0oin tablesto'ether
!ark for
Review (") #oints
E
(*)
ne /ore than the nu/ber of tables
$orrect
46. %hat ha&&ens when you create a $artesian &roduct !ark for
Review (") #oints
All rows fro/ one table are 0oined to all rows of another table (*)
The table is 0oined to itself, one colu/n to the ne<t colu/n, e<haustin'all &ossibilities The table is 0oined to another equal table
All rows that do not /atch in the %+R+ clause are dis&layed
$orrect
47. %hat is &roduced when a 0oin condition is not s&eci>ed in a /ulti&le@tablequery usin' racle &ro&rietary 6oin synta<
!ark for
Review (") #oints
A self@0oin
An outer 0oin
An equi0oin
A $artesian &roduct (*)
$orrect
48. You have been asked to create a re&ort that lists all cor&orate custo/ersand all orders that they have &laced. The custo/ers should be listedal&habetically be'innin' with the letter HAH, and their corres&ondin' ordertotals should be sorted fro/ the hi'hest a/ount to the lowest a/ount.%hich of the followin' state/ents should you issue
!ark for
Review (") #oints
7/17/2019 final ex s2 p2
http://slidepdf.com/reader/full/final-ex-s2-p2 16/16
1++$T c.custid, c.co/&anyna/e, o.orderdate, o. custid, o.a/ountFR! custo/ers c, orders o%+R+ c.custid ; o.custidR+R 7Y a/ount +1$, co/&anyna/e:1++$T c.custid, c.co/&anyna/e, o.orderdate, o. custid, o.a/ountFR! custo/ers c, orders o%+R+ c.custid ; o.custid
R+R 7Y co/&anyna/e, a/ount +1$:
(*)
1++$T c.custid, c.co/&anyna/e, o.orderdate, o. custid, o.a/ountFR! custo/ers c, orders o%+R+ c.custid ; o.custidR+R 7Y co/&anyna/e, a/ount:1++$T c.custid, c.co/&anyna/e, o.orderdate, o. custid, o.a/ountFR! custo/ers c, orders o%+R+ c.custid ; o.custidR+R 7Y co/&anyna/e A1$, a/ount A1$:
$orrect
49. You need to 0oin the +!#Y++1 table and the 1$+5+1 table, but thetwo tables do not have any corres&ondin' colu/ns. %hich ty&e of 0oin willyou create
!ark for
Review (") #oints
An equi0oin
-t is not &ossible to 0oin these two tables.
A non@equi0oin (*)
A full outer 0oin
$orrect
Section 16
(Answer all questions in this section)
50. 5nit testin' is done &rior to a database 'oin' into &roduction to ensure arando/ nu/ber of business require/ents functions &ro&erly. True or False
!ark for
Review (") #oints
True
False (*)
$orrect