2 bai trong nay. tim nhiu lan
TRANSCRIPT
-
8/12/2019 2 Bai Trong Nay. Tim Nhiu Lan
1/37
Database Processing, Ninth Edition
Part 1 of 1 - 18.0/ 20.0 Points
Question 1 of 20 1.0/ 1.0 Points
Because SQL statements are set-oriented, whereas programs are element-oriented, the results o SQL statementsused in programs are accessed using !!!!!!!..
". standard programming tools
B. an SQL cursor
#. an SQL trigger
$. custom written programming tools
Question 2 of 20 0.0/ 1.0 Points
SQL Ser%er program code that is e&ecuted a ter an SQL command has 'een processed is called a(n)*
". B+ trigger.
B. S +"$ trigger.
#. " + trigger.
$. B+ + trigger.
Question 3 of 20 1.0/ 1.0 Points
3ith this t4pe o SQL Ser%er cursor concurrenc4 no loc5 is o'tained until the user updates the data.
". P 6 S #
B. S# LL7L #
#. P+SS 6 S #
$. +"$7 L9
Question 4 of 20 1.0/ 1.0 Points
SQL triggers are used or!!!!!!!!!
7 - 1
-
8/12/2019 2 Bai Trong Nay. Tim Nhiu Lan
2/37
Chapter 7 - Database Processing, Ninth Edition
". %alidit4 chec5ing
B. pro%iding de ault %alues
#. updating %iews
$. "ll o the mentioned options
Question 5 of 20 1.0/ 1.0 Points
: he ollowing SQL statement is curror B;s data manipulation or ta'le ". 3hich is the correct character string to 'e entered in the 'lan52 3@+ + !!!!!!."("1, "2, "?) is the structure o ta'le ", the underline indicates the primar4 5e4:
". #= + B
B. "1>B
#. "1>#= + B
$. "1>B "
Question 6 of 20 1.0/ 1.0 Points
SQL triggers can 'e used when the $B6S recei%es a 777777777777reAuest
". insert
B. delete
#. update
$. "ll o the mentioned options
Question 7 of 20 1.0/ 1.0 Points
3hich o the ollowing is true concerning a procedure 10000C$+#L" + angeStep > 1C
3 @ um'er ange( temDalue)"S (S+L+# temDalue
6 (S+L+# angeStart "S temDalue) "S t= "LLS+L+# temDalue E angeStep
6 um'er ange3@+ + temDalue F ange+nd)
S+L+# temDalue6 um'er ange
P (6"G +#= S 100)
3hich result will 'e returned< :
".10,001 rows will 'e returned with a ma&imum recursion error.
B.101 rows will 'e returned with a ma&imum recursion error.
7 - 3
-
8/12/2019 2 Bai Trong Nay. Tim Nhiu Lan
4/37
Chapter 7 - Database Processing, Ninth Edition
#.101 rows will 'e returned with no error.
$.10,001 rows will 'e returned with no error.
Question 10 of 20 1.0/ 1.0 Points
" unction returns one %alue and has onl4 output parameters.
rue
alse
Question 11 of 20 1.0/ 1.0 Points
9ou are tas5ed to create a ta'le that has a column that must store the current time accurate to ten microseconds.9ou need to use a s4stem unction in conHunction with the $+ "=L option in the column de inition. 3hichs4stem unction should 4ou use#= + B
$. "1>B "
Question 2 of 20 1.0/ 1.0 PointsSQL triggers are created using !!!!!!!!.
". the SQL # +" + + statement
B. the SQL + statement
#. the SQL "$$ # S " + statement
$. the SQL "$$ + statement
Question 3 of 20 1.0/ 1.0 Points
=nli5e application code, stored procedures are ne%er distri'uted to 777777777777777
". the $B6S
B. the client computers
#. the networ5 ser%ers
$. the data'ase ser%ers
Question 4 of 20 0.0/ 1.0 Points
3hich o the ollowing statements is true concerning routines and triggers he ollowing data'ase is should 'e pro%ided to students as the 'asis or SQLe&les reAuired '4 some o the Auestions that ollow.
=E*ERA A E ATA A E>
A E REPa esRe"*o Re"*a+e Hire ate
K O Mones 01/02/1NNNR?O Smith 02/0?/2000?O #hen 01/2 /1NN8O?O Mohnson 11/2?/1NN8
C: T !ER Cust*o Cust*a+e a an$e a esRe"*o
N8R0 3inston 00 ?O8 N0 on ales ? 0 O?OR8O0 @arris 800 K OO8R0 6iles 100 ?O
NK. 3hat is an SQL %iew, and what is it used or< nclude an e&le 'ased on the #=S 6+ta'le o the eneral Sales $ata'ase.
An SQL 1ie2 is a 1irtual table constructed .ro database tables or other 1ie2s: 5t is based on theSQL C3EATE 45E6 co and and uses the SQL SELECT state ent to construct the 1ie2:
/o2e1er, the 3DE3 89 clause cannot be used 2hen creating a 1ie2: #or e CUST >E3?
A 1ie2 a$ be used to @* hide colu ns or ro2s, @! sho2 the results o. co puted colu ns, @%hide co plicated SQL state ents such as Boins, and @( pro1ide a le1el o. indirection bet2een thedata processed b$ applications and the actual table data:
NR. #ompare SQL %iews and the " S /SP" # e&ternal schema/user %iew.
An SQL 1ie2 is a 1irtual table constructed .ro database tables or other 1ie2s: The
ANS5 SPA3C e
-
8/12/2019 2 Bai Trong Nay. Tim Nhiu Lan
37/37
Chapter 7 - Database Processing, Ninth Edition
N8. 3hat is em'edded SQL, and what considerations are necessar4 when using it in an applicationS products t$picall$ pro1ide the eans o. doing this:Second, SQL is set-oriented and SQL results use tables or sets o. ro2s, 2hereas application
progra ing languages are ele ent- or ro2-oriented: This is resol1ed b$ treating SQL resultsas pseudo-.iles: A cursor is then used to o1e through the pseudo.ile one ro2 at a ti e:
NN. 3hat are SQL triggers and how are the4 usedS 2hene1er an insert, update or delete re uest is ade on the table or 1ie2 2ith thetrigger: There are three co onl$ used triggers= 8E# 3E, 5NSTEAD #, and A#TE3 @>S SQL
ser1er does not support 8E# 3E : This creates a set o. nine possible trigger t$pes= 8E# 3E F)5NSE3T or UPDATE or DELETE+, 5NSTEAD # F )5NSE3T or UPDATE or DELETE+, and
A#TE3 F )5NSE3T or UPDATE or DELETE+: Triggers are used @a ong other things .or @*1alidit$ chec ing, @! pro1iding de.ault 1alues, @% updating 1ie2s, and @( en.orcing re.erentialintegrit$ actions:
100. 3hat are SQL stored procedures and how are the4 used