Final Exam Semester 1

16
Test: Final Exam Semester 1 Review your answers, feedback, and question scores below. An asterisk (*) ind correct answer. Section 11 (Answer all questions in this section) 1. In a hysical data !odel, an attribute beco!es a """"""""""""". #ark for Review (1) $oints %able &orei'n ey onstraint olu!n (*) orrect . In a hysical data !odel, a relationshi is reresented as a co!bination of+ ( hoose %wo) #ark for Review (1) $oints ( hoose all correct answers) olu!n $ri!ary ey or nique ey (*) heck onstraint or nique ey &orei'n ey (*) orrect -. %he transfor!ation fro! an R dia'ra! to a hysical desi'n involves chan'in' ter!inolo'y. Secondary nique Identifiers beco!e #ark for Review (1) $oints olu!ns %ables nique onstraints (*) $ri!ary ey onstraints orrect /. %o resolve a !any to !any relationshi in a hysical !odel you create a0an """"""""""""""""""" #ark for Review (1) $oints

description

Final Exam Semester 1

Transcript of Final Exam Semester 1

Test: Final Exam Semester 1
Review your answers, feedback, and question scores below. An asterisk (*) indicates a
correct answer.
Section 11
1. In a hysical data !odel, an attribute beco!es a
 """"""""""""". #ark for Review
onstraint
olu!n (*)
orrect
. In a hysical data !odel, a relationshi is reresented as a
co!bination of+ (hoose %wo) #ark for Review
(1) $oints
&orei'n ey (*)
desi'n involves chan'in' ter!inolo'y. Secondary nique
Identifiers beco!e
/. %o resolve a !any to !any relationshi in a hysical
!odel you create a0an """"""""""""""""""" #ark for Review
(1) $oints
the!
orrect
2. In a concetual !odel, !any3to3!any relationshis are
resolved via a structure called a0an+ """""""""""""""" #ark for Review
(1) $oints
orrect
4. %he te5t below is an e5a!le of what constraint tye
%he value in the !ana'er"id colu!n of the #$678S
table !ust !atch a value in the e!loyee"id colu!n in
the #$678S table.
(1) $oints
olu!ns havin' $ri!ary eys, &orei'n eys, nique
eys, and heck constraints defined in the database.
%ables havin' $ri!ary eys, &orei'n eys, nique
eys, and heck constraints defined in the database.
(*)
orrect
:. If a ri!ary key is a set of colu!ns, then one colu!n
!ust be null. %rue or &alse #ark for Review
(1) $oints
%rue
&alse (*)
orrect
;. A forei'n key cannot refer to a ri!ary key in the sa!e
table. %rue or &alse #ark for Review
(1) $oints
%rue
&alse (*)
orrect
1<.A table !ust have a ri!ary key. %rue or &alse #ark for Review
(1) $oints
%rue
&alse (*)
orrect
Review your answers, feedback, and question scores below. An asterisk (*) indicates a
correct answer.
Section 11
(Answer all questions in this section)
11.=hen !ain' suertyes, relationshis at the suertye
level transfor! as usual. Relationshis at subtye level
are i!le!ented as forei'n keys, but the forei'n key
colu!ns all beco!e !andatory. %rue or &alse
#ark for Review
1.%he S>6 state!ent A6%R %A?6 #$678S
@6% 76# SA6AR8 is a valid state!ent. %rue
or &alse
%rue
&alse (*)
orrect.
1-.7nce you have created a table, it is not ossible to alter
the definition of it. If you need to add a new colu!n you
!ust delete the table definition and create a new, correct
table. %rue or &alse
%rue
&alse (*)
orrect.
1/.=hat co!!and will return data fro! the database to you #ark for Review
(1) $oints
orrect.
12.=hat co!!and can be used to create a new row in a table
in the database #ark for Review
(1) $oints
RA%
orrect.
14.%he @SRI? co!!and returns all rows fro! a table.
%rue or &alse #ark for Review
(1) $oints
19.@urin' which hases of the Syste! @evelo!ent 6ife
ycle would you test the syste! before rollin' it out to
the users
1:.Syste!s are always Dust rolled out as soon as the
 ro'ra!!in' hase is finished. o further work is
required once the develo!ent is finished. %rue or &alse
#ark for Review
(Answer all questions in this section)
1;.=hich S>6 keyword secifies that an alias will be
substituted for a colu!n na!e in the outut of a S>6
query
orrect.
<.=hich S>6 state!ent will return an error #ark for Review
(1) $oints
S6% * &R7# skyE
 
Review your answers, feedback, and question scores below. An asterisk (*) indicates a
correct answer.
Section 12
1.In which clause of a S6% state!ent would you
secify the na!e of the table or tables bein' queried #ark for Review
(1) $oints
Any of the above otionsE you can list tables
wherever you want in a S6% state!ent.
orrect.
.=hen you use the S6% clause to list one or two
colu!ns only fro! a table and no =BR clause, which
S>6 caability is used
#ark for Review
orrect.
-.In a S6% clause, what is the result of G - * #ark for Review
(1) $oints
1<
1-
orrect.
/.8ou want to create a list of all albu!s that have been
 roduced by the co!any. %he list should include the title
of the albu!, the artistHs na!e, and the date the albu! was
released. %he A6?#S table includes the followin'
colu!ns+
#ark for Review
A6?"@A% @A% 7% 66
infor!ation
&R7# albu!E
&R7# albu!sE
&R7# albu!sE
(Answer all questions in this section)
2.8ou want to retrieve a list of custo!ers whose last na!es
 be'in with the letters H&rH . =hich keyword should you
include in the =BR clause of your S6% state!ent
to achieve the desired result
#ark for Review
4.8ou want to deter!ine the orders that have been laced
 by custo!ers who reside in the city of hica'o. 8ou write
this artial S6% state!ent+
S6% orderid, orderdate, total
&R7# ordersE
=hat should you include in your S6% state!ent to
achieve the desired results
 
=BR city J hica'oE
orrect.
9.8ou want to retrieve a list of custo!ers whose last na!es
 be'in with the letters H&rH . =hich sy!bol should you
include in the =BR clause of your S6% state!ent
to achieve the desired result
#ark for Review
:.=hich of the followin' co!!ands will dislay the last
na!e concatenated with the Dob I@ fro! the e!loyees
table, searated by a co!!a and sace, and label the
resultin' colu!n N!loyee and %itleN
#ark for Review
(1) $oints
S6% N last na!eN OOH, HOO NDob"idN G N!loyee and
%itleN &R7# e!loyeesE
&R7# e!loyeesE (*)
S6% N last na!eN OOH, HOO NDob"idN G N!loyee and
%itleN &R7# e!E
&R7# e!loyeesE
;.=hich oerator is used to co!bine colu!ns of character
strin's to other colu!ns #ark for Review
(1) $oints
0
G
OO (*)
orrect.
-<.8ou need to dislay e!loyees whose salary is in the
ran'e of 1<<<< throu'h 2<<< for e!loyees in
deart!ent 2< . =hat does the =BR clause look like
#ark for Review
?%= 1<<<< A@ 2<<<
A@ salary ?%= 1<<<< A@ 2<<<
=BR deart!ent"id J 2<
A@ salary ?%= 2<<1 A@ 1<<<1
=BR deart!ent"id J 2<
A@ salary ?%= 1<<<< A@ 2<<<
(*)
orrect.
Review your answers, feedback, and question scores below. An asterisk (*) indicates a
correct answer.
Section 14
-1.=hen usin' the 6I condition, which sy!bol reresents
any sequence of characters of any len'th33ero, one, or
!ore characters
-.=hich clause would you include in a S6% state!ent
to restrict the data returned to only the e!loyees in
deart!ent 1<
#ark for Review
--.=hich co!arison oerator searches for a secified
character attern #ark for Review
(1) $oints
-/.=hich of the followin' ele!ents cannot be included in a
=BR clause #ark for Review
(1) $oints
6AS%"A# ARBAR(2)
&IRS%"A# ARBAR(2)
#AI6 ARBAR(2<)
8ou are writin' a S6% state!ent to retrieve the
na!es of e!loyees that have an e!ail address.
S6% last"na!eOOH, HOOfirst"na!e N!loyee a!eN
&R7# e!loyeesE
=hich =BR clause should you use to co!lete this
state!ent
=BR e!ail IS 7% 66E (*)
orrect.
#$678"I@ #?R(/) 7% 66
6AS%"A# ARBAR(12) 7% 66
&IRS%"A# ARBAR(1<) 7% 66
BIR"@A% @A% 7% 66
8ou want to roduce a reort that rovides the last na!es,
first na!es, and hire dates of those e!loyees who were
#ark for Review
=hich state!ents can you issue to acco!lish this task
S6% last"na!e, first"na!e, hire"date
&R7# e!loyees
H-<3AC3<<<HE
&R7# e!loyees
H<13#AR3<<<HE
&R7# e!loyees
hire"date PJ H-<3 AC3<<<HE
S6% last"na!e, first"na!e, hire"date
&R7# e!loyees
A@ hire"date QJ H<13#AR3<<<H and hire"date PJ
H-<3AC3<<<HE
(Answer all questions in this section)
-9.=hich state!ent about the lo'ical oerators is true #ark for Review
(1) $oints
%he order of oerator recedence is A@, 7R, and
 7%.
%he order of oerator recedence is A@, 7%, and
7R.
%he order of oerator recedence is 7%, 7R, and
A@.
%he order of oerator recedence is 7%, A@, and
7R. (*)
orrect.
-:.=hich clause would you include in a S6% state!ent
to sort the rows returned by the 6AS%"A# colu!n #ark for Review
(1) $oints
%oN #ark for Review
NJ)N
NGPN
NQJN
NPJN (*)
orrect.
/<.=hich state!ent about the default sort order is true #ark for Review
(1) $oints
 ull values are dislayed first.
haracter values are dislayed in reverse alhabetical
order.
orrect.
Review your answers, feedback, and question scores below. An asterisk (*) indicates a
correct answer.
Section 19
(Answer all questions in this section)
/1.&ro! left to ri'ht, what is the correct order of
$recedence #ark for Review
 7%, A@, 7R, Arith!etic
Arith!etic, 7%, oncatenation, 6o'ical
/.=hich of the followin' best describes the !eanin' of the
6I oerator #ark for Review
(1) $oints
%o test for values in a list.
#atch a character attern. (*)
%o find ull values.
&R7# e!loyees
%he rows will be sorted alhabetically by the
6AS%"A# values. (*)
%he rows will be sorted in reverse alhabetical order
 by the 6AS%"A# values.
%he rows will be sorted alhabetically by the
&IRS%"A# and then the 6AS%"A# values
orrect.
S6% e!loyee"id
  A@ (e!loyee"id ?%= 12< A@ <<)E
#ark for Review
 o rows will be returned
1<<, 1<1, 1<, 1<-, 1</, 1<9, 1/, 1/1, 1/, 1/-,
1//, 1/; (*)
S6% last"na!e, first"na!e, salary
&R7# e!loyeesE
#ark for Review
 
6AS%"A# colu!n only.
6AS%"A# and &IRS%"A# only.
%he results will be sorted ascendin' by
6AS%"A#, &IRS%"A#, and SA6AR8.
orrect.
S6% e!loyee"id, last"na!e, first"na!e, salary
H8early SalaryH
7R@R ?8 last"na!e, -E
=hich clause contains an error
#ark for Review
8early SalaryH (*)
&R7# e!loyees
7R@R ?8 last"na!e, -E
orrect.
S6% last"na!e, first"na!e, e!ail
&R7# e!loyees
state!ent is true
#ark for Review
(1) $oints
(*)
 ull e!ail values will not be dislayed in the result.
%he result will not be sorted.
orrect.
S6% e.e!loyee"id, e.last"na!e, e.first"na!e,
!.!ana'er"id
7R@R ?8 e.last"na!e, e.first"na!e
=BR e.e!loyee"id J !.!ana'er"idE
%his state!ent fails when e5ecuted. =hich chan'e will
correct the roble!
Re!ove the table aliases in the =BR clause.
Re!ove the table aliases in the 7R@R ?8 clause.
Include a BAIC clause.
orrect.
$6A8RS %A?6+
#AACR"I@ #?R(;)
$7SI%I7"I@ #?R(/)
8ou want to dislay all layersH na!es with osition 4;<<
or 'reater.
8ou want the layers na!es to be dislayed alhabetically
 by last na!e and then by first na!e.
=hich state!ent should you use to achieve the required
results
(*)
S6% last"na!e, first"na!e
S6% last"na!e, first"na!e
7R@R ?8 last"na!e @S, first"na!eE
 
#$678"I@ #?R(;) $
@$AR%#%"I@ #?R(;)
1.
first"na!e
.
&R7# e!loyees
#ark for Review
@$AR%#%"I@ values.
%here is no difference in the result between the two
state!ents.
(*)