Вы находитесь на странице: 1из 5

CIS 211C Database Design and SQL - Oracle KEY Assigned: Lab 7 Due: October 17 2!!

"
1. Do the following Try it/Solve it exercises: i. Section 17 Lesson 1 Slide 10: #1 nd ! 1. The " n ger of #lo$ l % st %oods wo&ld li'e to send o&t co&(ons for the &(co"ing s le. )e w nts to send one co&(on to e ch ho&sehold. *re te the S+L+*T st te"ent th t ret&rns the c&sto"er l st n "e nd " iling ddress. 1. S+L+*T D,ST,-*T l st.n "e/ ddress/city/ st te/ 0i( %123 f.c&sto"ers4 !. S&e/ 5o$/ nd 3oni6&e were the e"(loyees of the "onth. 7sing the f.st ffs t $le/ cre te S+L+*T st te"ent to dis(l y the res&lts s shown in the S&(er St r ch rt to the right. !. S+L+*T 89998::first.n "e ::89998::first.n "e::89998 ;S <S&(er St r< %123 f.st ffs4 Section 17 Lesson 1 Slide 11: #= nd 7

=. The owners of D>s on De" nd wo&ld li'e re(ort of ll ite"s in their D.*Ds t $le with the following col&"n he dings: ,nventory ,te"/ *D Title/ 3&sic ?rod&cer/ nd @e r ?&rch sed. ?re( re this re(ort. =. S+L+*T cd.n&"$er ;S <,nventory ,te"</ title ;S <*D Title</ (rod&cer ;S <3&sic ?rod&cer</ ye r ;S <@e r ?&rch sed< %123 d.cds 7. #lo$ l % st %oods h s decided to give ll st ff "e"$ers =A r ise. ?re( re re(ort th t (resents the o&t(&t s shown in the ch rt to the right.
+3?L2@++ L;ST -;3+ *711+-T S;L;1@ S;L;1@ B,T) =A 1;,S+

7. S+L+*T l st.n "e ;S <+3?L2@++ L;ST -;3+</ s l ry ;S <*711+-T S;L;1@</s l ry 9 1.0= ;S <S;L;1@ B,T) =A 1;,S+< %123 f.st ffs Section 17/ Lesson C Slide D: #1 nd E

1. 7sing the #lo$ l % st %oods d t $ se/ retrieve the c&sto"erFs first n "e/ l st n "e/ nd ddress for the c&sto"er whose ,D is C=G. 1. S+L+*T first.n "e/ l st.n "e/ ddress %123 f.c&sto"ers B)+1+ ,d H C=G4

CIS 211C Database Design and SQL - Oracle KEY Assigned: Lab 7 Due: October 17 2!!"
E. Show the n "e/ st rt d te/ nd end d te for #lo$ l % st %oods8 (ro"otion l ite" <$ ll(en nd highlighter< give w y. E. S+L+*T n "e/ st rt.d te/ end.d te/ give. w y %123 f.(ro"otion l."en&s B)+1+ give. w y H 8$ ll(en nd highlighter84 Section 17/ Lesson C Slide I: #=

=. The " n ger of D> on De" nd wo&ld li'e re(ort of ll the *D titles nd ye rs of *Ds th t were (rod&ced $efore E000. =. S+L+*T title/ ye r %123 d.cds B)+1+ ye r J E0004 Section 17/ Lesson C Slide 10: #D

%or the next three 6&estions/ &se the following t $le infor" tion: T;5L+ -;3+: st&dents *2L73-S: st&dentno -735+1KGL fn "e M;1*);1EK1EL ln "e M;1*);1KE0L sex *);1K1L " Nor M;1*);1EKECL D. Brite SOL st te"ent th t will dis(l y the st&dent n&"$er Kst&dentnoL of ny st&dent who h s ?+ " Nor in the t $le n "ed st&dents. Title the st&dentno col&"n St&dent -&"$er. D. S+L+*T st&dentno ;S St&dent -&"$er K;S is o(tion lL %123 st&dents B)+1+ " Nor H P?+F 4 Section 17/ Lesson C Slide 11: #11

11. Brite SOL st te"ent th t lists the #lo$ l % st %oods e"(loyees who were $orn $efore 1ID0. 11. S+L+*T first.n "e/ l st.n "e %123 f.st ffs B)+1+ $irthd te J 801Q>;-QD084

CIS 211C Database Design and SQL - Oracle KEY Assigned: Lab 7 Due: October 17 2!!"
ii. Section 17/ Lesson = Slide 11: #1 nd !

1. Dis(l y the first n "e/ l st n "e/ nd s l ry of ll #lo$ l % st %oods st ff whose s l ry is $etween R=.00 nd R10.00 (er ho&r. 1. S+L+*T first.n "e/ l st.n "e/ s l ry %123 f.st ffs B)+1+ s l ry 5+TB++- =.00 nd 10.004 !. 7sing only the less th n/ e6& l/ or gre ter th n o(er tors/ rewrite the following 6&ery: !. S+L+*T first.n "e/ l st.n "e %123 f.st ffs B)+1+ s l ry SH E0 nd s l ry JHG04 iii. Section 17/ Lesson = Slide 1E: #G nd D

G. Select ll the 2r cle d t $ se e"(loyees whose l st n "es end with <s .< *h nge the he ding of the col&"n to re d <?ossi$le * ndid tes.< G. S+L+*T l st.n "e ;S <?ossi$le * ndid tes< %123 e"(loyees B)+1+ l st.n "e L,T+ 8As84 D. Brite SOL st te"ent th t lists the songs in the D>s on De" nd inventory th t re ty(e code 77/ 1E/ or 1. D. S+L+*T title %123 d.songs B)+1+ ty(e.code ,- K 77/1E/1L4 iv. Section 1D/ Lesson 1 Slide D: #E nd C

E. Dis(l y the l st n "es of ll #lo$ l % st %oods e"(loyees who h ve <e< nd <i< in their l st n "es. E. S+L+*T l st.n "e %123 f.st ffs B)+1+ l st.n "e L,T+ 8AeA8 ;-D l st.n "e L,T+ 8AiA84 C. 7sing the e"(loyees t $le/ write 6&ery to dis(l y ll e"(loyees whose l st n "es st rt with <D< nd h ve < < nd <e< nywhere in their l st n "e. C. S+L+*T l st.n "e %123 e"(loyees B)+1+ l st.n "e L,T+ 8DA AeA8 or l st.n "e L,T+ 8DAeA 84

CIS 211C Database Design and SQL - Oracle KEY Assigned: Lab 7 Due: October 17 2!!"

v. Section 1D/ Lesson 1

Slide I: #= nd 7

=. ,n which ven&es did D>s on De" nd h ve events th t were not in (riv te ho"esU =. S+L+*T loc.ty(e %123 d.ven&es B)+1+ loc.ty(e -2T ,-K8?riv te )o"e8L4 7. Bho " ,U , w s hired $y 2r cle fter 3 y 1IID $&t $efore >&ne of 1III. 3y s l ry is less th n RD000 ye r nd , h ve n <en< in "y l st n "e. 7. S+L+*T first.n "e/ l st.n "e %123 e"(loyees B)+1+ l st.n "e L,T+ 8AenA8 nd s l ry J D000 nd hire.d te 5+TB++- 801Q>7-QID8 ;-D 8!1Q3;@QII84 Di n Lorent0 vi. Section 1D/ Lesson E Slide 7: #1 nd !

1. ,n the ex "(le $elow/ ssign the e"(loyee.id col&"n the li s of <-&"$er.< *o"(lete the SOL st te"ent to order the res&lts set $y the col&"n li s. S+L+*T e"(loyee.id/ first.n "e/ l st.n "e %123 e"(loyees4 1. S+L+*T e"(loyee.id ;S <-&"$er</ first.n "e/ l st.n "e %123 e"(loyees 21D+1 5@ <-&"$er<4 !. 2rder the D> on De" nd songs $y descending title. 7se the li s <2&r *ollection< for the song title. !. S+L+*T title ;S <2&r *ollection< %123 d.songs 21D+1 5@ title D+S*4

CIS 211C Database Design and SQL - Oracle KEY Assigned: Lab 7 Due: October 17 2!!"
vii. Section 1D/ Lesson E Slide D: #C

C. Brite SOL st te"ent &sing the 21D+1 5@ cl &se th t co&ld retrieve the infor" tion needed. Do not r&n the 6&ery. *re te list of st&dents who re in their first ye r of school. ,ncl&de the first n "e/ l st n "e/ st&dent ,D n&"$er/ nd ( r'ing (l ce n&"$er. Sort the res&lts l(h $etic lly $y st&dent l st n "e nd then $y first n "e. ,f "ore th n one st&dent h s the s "e l st n "e/ sort e ch first n "e in V to ; order. ;ll other res&lts sho&ld $e in l(h $etic l order K; to VL. ;nswers: C. S+L+*T first.n "e/ l st.n "e/ st&dent.id/ ye r.in.school/ ( r'ing.s( ce %123 st&dents B)+1+ ye r.in.school H 1 21D+1 5@ l st.n "e/ first.n "e D+S*4 Kex ct synt x n "es will v ryL

Вам также может понравиться