You are on page 1of 30

1.

You issue the following query:


SELECT salary "Employee Salary" FROM employees;
How will the column heading appear in the result?
A. EMPLOYEE SL!Y
B. EMPLOYEE"SL!Y
C. Employee Salary
D. employee"salary
2. #he EMP ta$le is defined as follows:
Column Datatype Length
EMP%O %&M'E! (
E%ME )!*H!+ ,-
SL!Y %&M'E! .(/+
*OMM %&M'E! .-/+
0EP#%O %&M'E! +
You perform the following two queries:
1. SELECT empno enumber, ename
FROM emp ORDER BY 1;
2. SELECT empno, ename
FROM emp ORDER BY empno SC;
1hich of the following is true?
A. Statements . and + will produce the same result2
B. Statement . will e3ecute4 statement + will return an error2
C. Statement + will e3ecute4 statement . will return an error2
D. Statements . and + will e3ecute $ut produce different results2
EMP #a$le
3. You issue the following SELECT statement on the EMP ta$le shown in question +2
SELECT !2""#!!salary$".1%&2%% FROM emp;
1hat will happen to the result if all of the parentheses are remo5ed?
A. %o difference/ $ecause the answer will always $e '(LL2
B. %o difference/ $ecause the result will $e the same2
C. #he result will $e higher2
D. #he result will $e lower2
4. 6n the following SELECT statement/ which component is a literal?
7*hoose all that apply28
SELECT )Employee 'ame* ) ++ ename
FROM emp ,-ere .ep/no 0 1";
A. .-
B. ename
C. Employee %ame:
D. ++
5. 1hen you try to sa5e ,(9:;2++99 into a column defined as %&M'E!7;/+8 what 5alue is actually sa5ed?
A. ,(9:;2--
B. ,(9:;2+,
C. ,(9:;2++
D. ,(9:2++
6. 1hat is the default display length of the 0#E datatype column?
A. <
B. =
C. .=
D. :
7. 1hat will happen if you query the EMP ta$le shown in question + with the following?
SELECT empno, D1ST1'CT ename, salary FROM emp;
A. EMP%O/ unique 5alues of E%ME and then SL!Y are displayed2
B. EMP%O/ unique 5alues of the two columns/ E%ME and SL!Y/ are displayed2
C. D1ST1'CT is not a 5alid >eyword in S?L2
D. %o 5alues will $e displayed $ecause the statement will return an error2
8. 1hich clause in a query limits the rows selected?
A. ORDER BY
B. 23ERE
C. SELECT
D. FROM
=21hen you issue the following query/ which 5alue will $e displayed in the first row?
SELECT empno FROM emp 23ERE .ep/no 0 1"
ORDER BY ename DESC;
A. M6LLE!
B. ;=,(
C. ;<;:
D. %o rows will $e returned $ecause ename cannot $e used in the ORDER BY clause2
10. !efer to the listing of records in the EMP ta$le in question =2 How
many rows will the following query return?
SELECT $ FROM emp 23ERE ename BET2EE' )) 'D )C)
A. (
B. +
C. character column cannot $e used in the BET2EE' operator2
D. ,
11. !efer to the EMP ta$le in question +2 1hen you issue the following
query/ which line has an error?
SELECT empno "Enumber", ename "Emp'ame"
FROM emp
23ERE .ep/no 0 1"
'D "Enumber" 0 4452
ORDER BY "Enumber";
A. .
B. 9
C. (
D. %o error4 the statement will finish successfully2
12. You issue the following query:
SELECT empno, ename FROM emp
23ERE empno 0 4452 OR empno 0 4546;
1hich other operator can replace the OR condition in the 23ERE clause?
A. 1'
B. BET2EE' 22 'D 22
C. L17E
D. 80
E. 90
13. #he following are clauses of the SELECT statement:
.2 23ERE
+2 FROM
,2 ORDER BY
6n which order should they appear in a query?
A. ./ ,/ +
B. +/ ./ ,
C. +/ ,/ .
D. #he order of these clauses does not matter2
14. 1hich statement searches for P!O0&*#"60 5alues that $egin with
06" from the O!0E!S ta$le?
A. SELECT $ FROM ORDERS 23ERE :ROD(CT;1D 0 )D1<);
B. SELECT $ FROM ORDERS 23ERE :ROD(CT;1D L17E )D1;) ESC:E )=);
C. SELECT $ FROM ORDERS 23ERE :ROD(CT;1D L17E )D1=;<) ESC:E )=);
D. SELECT $ FROM ORDERS 23ERE :ROD(CT;1D L17E )D1=;) ESC:E )=);
E. SELECT $ FROM ORDERS 23ERE :ROD(CT;1D L17E )D1;<> ESC:E )=);
15. *O&%#!Y"%ME and !E@6O%"60 are 5alid column names in the
*O&%#!6ES ta$le2 1hich one of the following statements will
e3ecute without an error?
A. SELECT ?oun/ry;name, re@Aon;A.,
CSE re@Aon;A. 0 1 T3E' )Europe),
re@Aon;A. 0 2 T3E' )merA?a),
re@Aon;A. 0 B T3E' )sAa),
ELSE )O/-er) E'D Con/Anen/
FROM ?oun/rAes;
B. SELECT ?oun/ry;name, re@Aon;A.,
CSE !re@Aon;A. 23E' 1 T3E' )Europe),
23E' 2 T3E' )merA?a),
23E' B T3E' )sAa),
ELSE )O/-er)% Con/Anen/
FROM ?oun/rAes;
C. SELECT ?oun/ry;name, re@Aon;A.,
CSE re@Aon;A. 23E' 1 T3E' )Europe)
23E' 2 T3E' )merA?a)
23E' B T3E' )sAa)
ELSE )O/-er) E'D Con/Anen/
FROM ?oun/rAes;
D. SELECT ?oun/ry;name, re@Aon;A.,
CSE re@Aon;A. 23E' 1 T3E' )Europe)
23E' 2 T3E' )merA?a)
23E' B T3E' )sAa)
ELSE )O/-er) Con/Anen/
FROM ?oun/rAes;
16. 1hich special character is used to query all the columns from the ta$le
without listing each column $y name?
A. <
B. C
C. D
D. $
17. #he EMPLOYEE ta$le has the following data:
EM:;'ME 31RE;DTE SLRY
EEEEEEEEEE EEEEEEEEE EEEEEEEEEE
SM1T3 14EDECEF" 5""
LLE' 2"EFEBEF1 16""
2RD 22EFEBEF1 12G"
HO'ES "2E:REF1 GF4G
2RDE' 25ESE:EF1 12G"
BL7E "1EMYEF1 25G"
1hat will $e the 5alue in the first row of the result set when the
following query is e3ecuted?
SELECT -Are;.a/e FROM employee ORDER BY salary, emp;name;
A. -+AP!A=.
B. .;A0E*A=-
C. +<ASEPA=.
D. #he query is in5alid/ $ecause you cannot ha5e a column in the
ORDER BY clause that is not part of the SELECT clause2
18. 1hich S?L statement will query the EMPLOYEES ta$le for B6!S#"
%ME/ LS#"%ME/ and SL!Y of all employees in
0EP!#ME%#"60 (- in the alpha$etical order of last name?
A. SELECT IArs/;name las/;name salary
FROM employees
ORDER BY las/;name
23ERE .epar/men/;A. 0 J";
B. SELECT IArs/;name, las/;name, salary
FROM employees
ORDER BY las/;name SC
23ERE .epar/men/;A. 0 J";
C. SELECT IArs/;name las/;name salary FROM employees
23ERE .epar/men/;A. 0 J"
ORDER BY las/;name SC;
D. SELECT IArs/;name, las/;name, salary
FROM employees 23ERE .epar/men/;A. 0 J"
ORDER BY las/;name;
E. SELECT IArs/;name, las/;name, salary
FROM TBLE employees 23ERE .epar/men/;A. 1S J"
ORDER BY las/;name SC;
19. 1hen doing pattern matching using the L17E operator/ which character
is used as the default escape character $y Oracle?
A. C
B. D
C. E
D. #here is no default escape character in Oracle=i2
20. *olumn alias names cannot $e used in which clause?
A. SELECT clause
B. 23ERE clause
C. ORDER BY clause
D. %one of the a$o5e
1. 1hat is wrong with the following statements su$mitted in S?LFPlus?
DEF1'E K;DE:T'O 0 2"
SELECT LST;'ME, SLRY
FROM EM:LOYEES
23ERE DE:RTME'T;1D 0 K;Dep/'o;
A. %othing is wrong2 #he query lists the employee name and salary of
the employees who $elong to department +-2
B. #he DEF1'E statement declaration is wrong2
C. #he su$stitution 5aria$le is not preceded with the C character2
D. #he su$stitution 5aria$le in the 23ERE clause should $e K;DE:T'O
instead of K;Dep/'o2
2. 1hich command in S?LFPlus is used to sa5e the query output to a file?
A. :R1'T
B. SKE
C. RE:LCE
D. S:OOL
3. How would you e3ecute a S?L statement in the S?L $uffer of
S?LFPlus? 7*hoose all that apply28
A. Enter a slash 7&82
B. Enter an ampersand 7C82
C. Enter a semicolon 7;82
D. Press *trlG0 7H082
4. You issue the S?LFPlus command S:OOL O'2 1hich tas> is accomplished?
A. #he ne3t screen output from the S?LFPlus session is sa5ed into a file named aIAe./.buI2
B. #he ne3t screen output from the S?LFPlus session is sa5ed into afile named O'.ls/2
C. #he ne3t screen output from the S?LFPlus session is sent to the printer2
D. %othing happens4 a filename is missing from the command2
5. 1hich S?LFPlus command always o5erwrites a file?
A. S:OOL
B. R('
C. RE:LCE
D. SKE
6. 1hich S?LFPlus command is used to display a title on e5ery page of
the report?
A. TO:T1TLE
B. T1TLE
C. TT1TLE
D. RE:T1TLE
7. *hoose two commands that are not 5alid in iS?LFPlus2
A. :SS2ORD
B. TT1TLE
C. CO''ECT
D. EL1T
8. 1hich character is used to indicate that the command is continued on
the ne3t line in S?LFPlus?
A. E
B. &
C. =
D. 9
9. You ha5e the following S?L in the S?L $uffer of S?LFPlus:
SELECT EM:LOYEE;1D, LST;'ME
FROM EM:LOYEES
23ERE LST;'ME 0 F1RST;'ME
ORDER BY LST;'ME
You perform the following S?LFPlus commands on the $uffer:
B
?&'ME&'MES&
1hich S?L command will $e in the $uffer?
A. SELECT EM:LOYEE;1D, LST;'MES FROM EM:LOYEES
23ERE LST;'MES 0 F1RST;'MES ORDER BY LST;'MES
B. SELECT EM:LOYEE;1D, LST;'ME
FROM EM:LOYEES
23ERE LST;'MES 0 F1RST;'ME
ORDER BY LST;'ME
C. SELECT EM:LOYEE;1D, LST;'ME
FROM EM:LOYEES
23ERE LST;'MES 0 F1RST;'MES
ORDER BY LST;'ME
D. SELECT EM:LOYEE;1D, LST;'ME
FROM EM:LOYEES
23ERE LST;'ME 0 F1RST;'ME
ORDER BY LST;'ME
10. 1hich of the following is the correct synta3 to define a 5aria$le?
A. DEF1'E variable0value
B. DEF1'E variable datatype *0 value
C. DEF1'E Cvariable
D. DEF1'E variable value
E. %one of the a$o5e
11. 1hich SET option turns off the display of the old and new S?L
statement line when 5aria$les are used?
A. EC3O OFF
B. 3ED1'M OFF
C. KER1FY OFF
D. FEEDBC7 OFF
E. DEF1'E OFF
12. 1hich of the following is not a 5alid option with the SKE command?
A. CRETE
B. RE:LCE
C. ::E'D
D. 1'SERT
13. You e3ecute the following lines of code in S?LFPlus:
SNL9 SELECT .epar/men/;A., IArs/;name, salary
2 FROM employees
B 23ERE IArs/;name L17E )S<)
J ORDER BY .epar/men/;A., IArs/;name
G
SNL9 COL(M' .epar/men/;A. FORMT 2"
SNL9 C&.epar/men/;A.&employee;A.
1hich of the following $est descri$es the code?
A. #he department"id in the COL(M' command is replaced with
employee"id2
B. #he department"id in the COL(M' command is cleared 7deleted82
C. #he department"id in the fourth line of the SELECT statement is
replaced with employee"id2
D. ll the department"id occurrences in the SELECT statement are
replaced with employee"id2
14. 1hich of the following is not a 5alid method for including comments?
A. Prefi3 comments with EE2
B. 'egin comment line with REMR72
C. 'egin comment line with O.
D. 6nclude comments $etween &$ and $&.
15. *onsider the following S?L:
SELECT .epar/men/;A., las/;name, salary FROM employees
ORDER BY .epar/men/;A., las/;name
1hich S?LFPlus command7s8 will display the total salary for each
department and suppress listing of duplicate department 60s?
A. COM:(TE S(M OF SLRY O' DE:RTME'T;1D
BRE7 O' DE:RTME'T;1D
B. BRE7 O' DE:RTME'T;1D 'OD(:L1CTES
COM:(TE S(M O' SLRY FOR DE:RTME'T;1D
C. BRE7 O' DE:RTME'T;1D 'OD(:L1CTES P
S(M O' SLRY
D. %one of the a$o5e2 S?LFPlus cannot $e used to total column 5alues2
16. 1hen using iS?LFPlus/ how do you write the query results to a file?
A. &se the S:OOL command to specify an output filename2
B. &se the Output dropAdown $utton and select Bile2
C. Perform option and '2
D. Perform either option or '2
17. 1hat will happen when you clic> the E3ecute $utton with the following
S?L in iS?LFPlus?
SELECT employee;A., las/;name, IArs/;name FROM employees
23ERE .epar/men/;A. 0 C.ep/A.
A. %othing will happen/ $ecause the statement is missing a ;2
B. n error is produced/ $ecause su$stitution 5aria$les are not
allowed in iS?LFPlus2
C. new window will $e opened to accept the 5alue for DE:T1D2
D. #he cursor mo5es to the string input area to accept 5alue for 0EP#602
18. 1hich two statements regarding su$stitution 5aria$les are true?
A. Cvariable is defined $y S?LFPlus/ and its 5alue will $e a5aila$le
for the duration of the session2
B. CCvariable is defined $y S?LFPlus/ and its 5alue will $e a5aila$le
for the duration of the session2
C. Cn 7where n is a any integer8 5aria$les are defined $y S?LFPlus
when 5alues are passed in as arguments to the script/ and their
5alues will $e a5aila$le for the duration of the session2
D. CCvariable is defined $y S?LFPlus/ and its 5alue will $e a5aila$le
only for e5ery reference to that 5aria$le in the current S?L2
19. #he contents of the script file MYSNL.sQl are as follows:
SET :MES GG L1'ES 5" FEEDBC7 OFF
SELECT las/;name, IArs/;name
FROM employees
23ERE employee;A. 0 CempA.;
1hat will happen when you issue the STRT MYSNL 1"1 command?
A. .-. will $e su$stituted for the 5aria$le EM:1D2
B. You will $e prompted to enter a 5alue for EM:1D2
C. n error will $e returned $ecause EM:1D is not preceded $y CC2
20. #he EMP ta$le is defined with the following columns:
EM:1D '(MBER !G%
E'ME KRC3R2 !B"%
HOB;T1TLE KRC3R2 !B"%
You e3ecute the following S?L/ and supply a 5alue as shown2
SNL9 SELECT $ FROM EM:
2 23ERE E'ME 0 Cname;
En/er Ralue Ior name* John
1hat will $e the result?
A. ll the column 5alues from the EMP ta$le are displayed for the
record with E%ME as Iohn2
B. n error is returned/ $ecause Iohn is a character literal and must $e
enclosed in quotation mar>s2
C. n error is returned/ $ecause 'ame is a reser5ed word in S?LFPlus/
so it cannot $e used as a 5aria$le2
D. #he input 5alue Iohn will $e con5erted to uppercase/ and 5alues
from the EMP ta$le are displayed for the record with E%ME
as IOH%2
1. You want to display each proJectKs start date as the day/ wee>/ num$er/
and year2 1hich statement will gi5e output li>e the following?
Tues.ay 2eeS 2B, 2""2
A. Sele?/ proT;A., /o;?-ar!s/ar/;.a/e, )DO2 2eeS 2OY
YYYY)% Irom proTe?/s
B. Sele?/ proT;A., /o;?-ar!s/ar/;.a/e,)Day)++) 2eeS)++)
2OY, YYYY)% Irom proTe?/s;
C. Sele?/ proT;A., /o;?-ar!s/ar/;.a/e,)Day" 2eeS" 22,
YYYY)% Irom proTe?/s;
D. Sele?/ proT;A., /o;?-ar!s/ar/;.a/e,>Day 2eeSO , YYYY)%
Irom proTe?/s;
E. You canKt calculate wee> num$ers with Oracle2
2. 1hat will the following statement return?
SELECT las/;name, IArs/;name, s/ar/;.a/e
FROM employees
23ERE -Are;.a/e 8 TR('C!SYSDTE% P G;
A. Employees hired within the past 9 years
B. Employees hired within the past 9 days
C. Employees hired more than 9 years ago
D. Employees hired more than 9 days ago
3. 1hich assertion a$out the following statements is most true?
SELECT name, re@Aon;?o.e++p-one;number
FROM ?us/omers;
SELECT name, CO'CT!re@Aon;?o.e,p-one;number%
FROM ?us/omers;
A. 6f the !E@6O%"*O0E is '(LL/ the first statement will not include
that customerKs PHO%E"%&M'E!2
B. 6f the !E@6O%"*O0E is '(LL/ the second statement will not
include that customerKs PHO%E"%&M'E!2
C. 'oth statements will return the same data2
D. #he second statement will raise an e3ception if the !E@6O%"
*O0E is '(LL for any customer2
4. 1hich singleArow function could you use to return a specific portion
of a character string?
A. 1'STR
B. S(BSTR
C. L:D
D. LEST
5. #he Sales department is simplifying the pricing policy for all products2
ll surcharges are $eing incorporated into the $ase price for all products
in the consumer di5ision 7code *8/ and the new $ase price is
increasing $y the lesser of -29 percent of the old $ase price or .- percent
of the old surcharge2 &sing the P!O0&*# ta$le descri$ed $elow/
you need to implement this change2
Column Name s>u name di5ision $ase"price surcharge
Key Type p>
NULLs/Unique %% %% %% %%
FK Table
Datatype %&M'E! )!*H!+ )!*H!+ %&M'E! %&M'E!
Length .: .: ( ../+ ../+
1hich of the following statements will achie5e the desired results?
A. (:DTE pro.u?/ SET
base;prA?e 0 base;prA?e # sur?-ar@e #
LEST!base;prA?e $ ".""G
,sur?-ar@e $ ".1%
,sur?-ar@e 0 '(LL
23ERE .ARAsAon0)C)
B. (:DTE pro.u?/ SET
base;prA?e 0 base;prA?e # 'KL!sur?-ar@e,"% #
LEST!base;prA?e $ ".""G
,sur?-ar@e $ ".1%
,sur?-ar@e 0 '(LL
23ERE .ARAsAon0)C)
C. (:DTE pro.u?/ SET
base;prA?e 0 base;prA?e # 'KL!sur?-ar@e,"% #
COLESCE!LEST!base;prA?e$".""G
,sur?-ar@e $ ".1%
,base;prA?e $ ".""G%
,sur?-ar@e 0 '(LL
23ERE .ARAsAon0)C)
D. / '/ and * will all achie5e the desired results2
E. %one of these statements will achie5e the desired results2
6. 1hich function7s8 accept arguments of any datatype? 7*hoose all that apply28
A. S(BSTR
B. 'KL
C. RO('D
D. DECODE
E. S1M'
7. 1hat will $e returned $y S1M'!BS!'KL!EB2,"%%%?
A. .
B. ,+
C. L.
D. -
E. '(LL
8. One of your data$ase users as>ed you to pro5ide a command that will
show her the 'LS;DTE;FORMT that is currently set in her session2
1hich command would you recommend?
A. SELECT SYS;CO'TELT!)(SERE'K), )'LS;DTE;FORMT)%
FROM .ual;
B. SELECT SYS;CO'TELT!)'LS;DTE;FORMT)% FROM .ual;
C. SELECT SYS;CO'TELT!)'LS;DTE;FORMT),)(SERE'K)%
FROM .ual;
D. SELECT 'LS;DTE;FORMT FROM .ual;
9. 1hich two functions could you use to strip leading characters from a
character string?
A. LTR1M
B. S(BSTR
C. RTR1M
D. 1'STR
E. MOD
10. You ha5e $een as>ed to randomly assign +9 percent of the employees to
a new training program2 Employee num$ers are assigned as consecuti5e
num$ers to the employees2 1hich statement $elow will print the
employee num$er and name of e5ery fourth employee?
A. SELECT MOD!empno, J%, ename
FROM employees
23ERE MOD!empno,J% 0 ";
B. SELECT empno, ename
FROM employees
23ERE MOD!empno, J% 0 .2G;
C. SELECT MOD!empno, J% ename
FROM employees
23ERE MOD!empno, J% 0 ";
D. SELECT empno, ename
FROM employees
23ERE MOD!empno, J% 0 ";
11. 1hich function will con5ert the S*66 code =; to its equi5alent letter a?
A. SC!F4%
B. SC11STR!F4%
C. SC11!F4%
D. C3R!F4%
12. 1hich date components does the C(RRE'T;T1MESTM: function
display?
A. Session date/ session time/ and session time Mone offset
B. Session date and session time
C. Session date and session time Mone offset
D. Session time Mone offset
13. &sing the SLESPE!SO%"!E)E%&E ta$le descri$ed $elow/ which
statements will properly display the #O#L"!E)E%&E 7*!"
SLES G 1!!%#Y"SLES8 of each salesperson?
A. SELECT salesperson;A.,?ar;sales,,arran/y;sales
,?ar;sales # ,arran/y;sales /o/al;sales
FROM salesperson;reRenue;
B. SELECT salesperson;A.,?ar;sales,,arran/y;sales
,?ar;sales # 'KL2!,arran/y;sales,"% /o/al;sales
FROM salesperson;reRenue;
C. SELECT salesperson;A.,?ar;sales,,arran/y;sales
,'KL2!,arran/y;sales, ?ar;sales
# ,arran/y;sales, ?ar;sales% /o/al;sales
FROM salesperson;reRenue;
D. SELECT salesperson;A.,?ar;sales,,arran/y;sales
,?ar;sales # COLESCE!?ar;sales, ,arran/y;sales,
?ar;sales
# ,arran/y;sales% /o/al;sales
FROM salesperson;reRenue;
14. 1hich function could $e used to return the 6P address for the machine
where the client session connected from?
A. COO71E
B. 'ET1'FO
C. SYS;CO'TELT
D. SYS;CO''ECT;BY;:T3
15. 6n Oracle/ what do trigonometric functions operate on?
A. 0egrees
B. !adians
C. @radients
D. #he default is radians/ $ut degrees or gradients can $e specified2
16. 1hat will the following S?L statement return?
SELECT COLESCE!'(LL,>Ora?le >,>Cer/AIAe.>% FROM .ual;
A. '(LL
B. Oracle
C. *ertified
D. Oracle *ertified
17. 1hich e3pression will always return the date one year later than the
current date?
A. SYSDTE # B6G
B. SYSDTE # TO;YM1'TERKL!>"1E"">%
C. C(RRE'T;DTE # 1
D. 'E2;T1ME!C(RRE'T;DTE,1,>YER>%
18. 1hich function will return a #6MES#MP 16#H #6ME NO%E
datatype?
A. C(RRE'T;T1MESTM:
B. LOCLT1MESTM:
C. C(RRE'T;DTE
D. SYSDTE
19. 1hich statement would change all occurrences of the string )1BM) to
the string OS(') in the 0ES*!6P#6O% column of the )E%0O! ta$le?
A. SELECT TR'SLTE!.es?rAp/Aon, )1BM), )S(')% FROM Ren.or
B. SELECT CO'KERT!.es?rAp/Aon, )1BM), )S(')% FROM Ren.or
C. SELECT ELTRCT!.es?rAp/Aon, )1BM), )S(')% FROM Ren.or
D. SELECT RE:LCE!.es?rAp/Aon, )1BM), )S(')% FROM Ren.or
20. 1hich function implements 6B22#HE%PELSE logic?
A. 1'1TC:!%
B. RE:LCE!%
C. DECODE!%
D. 1FELSE!%
1. 1hich function should $e used to assign ran>ings to rows/ gi5ing
duplicate ran>ing for ties/ and not s>ip any ran>s after ties?
A. DE'SE;R'7
B. S:RSE;R'7
C. R'7
D. RO2'(M
2. 1hich statement will generate the most rows?
A. select O!0E!"MO0E/SLES"!EP"60/ sum7O!0E!"#O#L8
from oe2orders
group $y !OLL&P 7O!0E!"MO0E/SLES"!EP"6084
B. select O!0E!"MO0E/SLES"!EP"60/ sum7O!0E!"#O#L8
from oe2orders
group $y *&'E 7O!0E!"MO0E/SLES"!EP"6084
C. select O!0E!"MO0E/SLES"!EP"60/ sum7O!0E!"#O#L8
from oe2orders group $y O!0E!"MO0E/SLES"!EP"604
D. #hey will all generate the same num$er of rows2
3. 'ased on the output $elow/ which MRO(: BY clause was used?
DE:RTME'T;1D YER CO('T!$%
EEEEEEEEEEEEE EEEE EEEEEEEEEE
B" 1FFF 1
B" 1
G" 1FFF F
G" 2""" J
G" 1B
6" 1FFF 1
6" 1
5" 1FFF G
5" 2""" 4
5" 12
1"" 1FFF 1
1"" 1
1FFF 1
1
2F
A. MRO(: BY C(BE!.epar/men/;A.,/o;?-ar!-Are;
.a/e,)YYYY)%%
B. MRO(: BY .epar/men/;A.,/o;?-ar!-Are;.a/e,)YYYY)%
C. MRO(: BY ROLL(:!.epar/men/;A.,/o;?-ar!-Are;
.a/e,)YYYY)%%
D. MRO(: BY .epar/men/;A.,ROLL(:!,/o;?-ar!-Are;
.a/e,)YYYY)%%
4. 1hich of the following group functions can return a '(LL?
A. M1'
B. ML
C. KR1'CE
D. KR;SM:
5. 1hich of the functions $elow requires a MRO(: BY clause in the S?L
statement?
A. C(BE
B. MRO(:1'M
C. MRO(:;1D
D. ll of the a$o5e
E. %one of the a$o5e
6. 1hich of the following functions is not an Oracle group function?
A. REMR;SLY
B. CORR
C. S7E2
D. COKR;:O:
E. ll of the a$o5e functions are 5alid2
7. 1hat is the MRO(:1'M function used for?
A. #he MRO(:1'M function is identical to the MRO(: BY function/ $ut
e3ecutes faster2
B. #he MRO(:1'M function is used to eliminate '(LL 5alues prior to
aggregation2
C. #he MRO(:1'M function identifies superaggregate rows2
D. #he MRO(:1'M function is deprecated in Oracle =i and should not
$e used2
8. How will the results of the following two statements differ?
S/a/emen/ 1*
SELECT ML!lon@A/u.e%, ML!la/A/u.e%
FROM UAp;s/a/e;?A/y;
S/a/emen/ 2*
SELECT ML!lon@A/u.e%, ML!la/A/u.e%
FROM UAp;s/a/e;?A/y
MRO(: BY s/a/e;
A. Statement . will fail $ecause it is missing a MRO(: BY clause2
B. Statement + will return one row/ and statement . may return more than one row2
C. Statement + will display a longitude and latitude for each N6P"
S##E"*6#Y2
D. Statement . will display two 5alues/ and statement + will display
two 5alues for each state2
9. 1hich group functions would you use to compute the mean and
median 5alues for a set of data?
A. ME' and MED1'
B. KM and :ERCE'T1LE;CO'T
C. ME' and :ERCE'T1LE;D1SC
D. KM and MED1'
10. &sing the SLES ta$le descri$ed $elow you need to report the following:
_ @ross/ net/ and earned re5enue
_ Bor the second and third quarters of .===
_ Bor sales in the states 6llinois/ *alifornia/ and #e3as 7codes 6L/
*/ and #Q8
1ill all the requirements $e met with the following S?L statement?
SELECT s/a/e;?o.e, S(M!LL @ross%, S(M!ne/%,
S(M!earne.%
FROM sales;.e/aAl
23ERE TR('C!sales;.a/e,>N>% BET2EE'
TO;DTE!>"1EprE1FFF>,>DDEMonEYYYY>%
'D TO;DTE!>"1ESepE1FFF>,>DDEMonEYYYY>%
'D s/a/e;?. 1' !>1L>,>C>,>TL>%
MRO(: BY s/a/e;?o.e;
A. #he statement meets all three requirements2
B. #he statement meets two of the three requirements2
C. #he statement meets one of the three requirements2
D. #he statement meets none of the three requirements2
E. #he statement will raise an e3ception2
11. 1hich assertion a$out the following queries is true?
SELECT CO('T!D1ST1'CT m@r%, ML!D1ST1'CT salary%
FROM emp;
SELECT CO('T!LL m@r%, ML!LL salary%
FROM emp;
A. #hey will always return the same num$ers in columns . and +2
B. #hey may return different num$ers in column . $ut will always
return the same num$er in column +2
C. #hey may return different num$ers in column . and may return
different num$ers in column +2
D. #hey will always return the same num$er in column . $ut may
return different num$ers in column +2
12. 1hich line in the following statement will raise an e3ception?
1 SELECT .epar/men/;A. ,CO('T!$%
2 ,KR;:O:!D1ST1'CT salary%
B ,KR;:O:!salary%
J FROM -r.employees
G MRO(: BY .epar/men/;A.;
A. Line .
B. Line +
C. Line ,
D. Line 9
E. #here is no error2
13. 1hat will the following S?L statement return?
sele?/ mAn!?us/;An?ome;leRel%
Seep !.ense;ranS las/ or.er by ?us/;?re.A/;lAmA/%
Irom s-.?us/omers;
A. #he smallest *&S#"6%*OME"LE)EL in the *&S#OME!S ta$le
B. #he smallest *&S#"6%*OME"LE)EL and the highest *&S#"
*!E06#"L6M6# in the *&S#OME!S ta$le
C. #he minimum *&S#"6%*OME"LE)EL for the ma3imum
*&S#"*!E06#"L6M6#
D. #he missing comma will raise a synta3 error2
14. How will the results of the following two statements differ?
S/a/emen/ 1*
SELECT CO('T!$%, S(M!salary%
FROM -r.employees;
S/a/emen/ 2*
SELECT CO('T!salary%, S(M!salary%
FROM -r.employees;
A. Statement . will return one row/ and statement + may return more
than one row2
B. 'oth statements will fail $ecause they are missing a MRO(: BY
clause2
C. 'oth statements will return the same results2
D. Statement + may return a smaller CO('T 5alue than statement .2
15. How will the results of the following two statements differ?
S/a/emen/ 1*
SELECT CO('T!?us/;@en.er%
FROM s-.?us/omers;
S/a/emen/ 2*
SELECT re@r;?oun/!?us/;marA/al;s/a/us,?us/;@en.er%
FROM s-.?us/omers;
A. Statement + may return a smaller CO('T 5alue than statement .2
B. 'oth statements will return the same results2
C. Statement . will return one row/ and statement + may return more
than one row2
D. 'oth statements will fail $ecause they are missing a MRO(: BY
clause2
16. 1hich of the following is not a group function?
A. KM!%
B. CO('T!%
C. LEST!%
D. STDDEK!%
E. CORR!%
17. 1hy does the following SELECT statement fail?
SELECT ?olorname Colour, ML!?os/%
FROM A/em.e/aAl
23ERE (::ER!?olorname% L17E )<231TE<)
MRO(: BY ?olour
3K1'M CO('T!$% 9 2";
A. MRO(: BY clause cannot contain a column alias2
B. #he condition CO('T!$% 9 2" should $e in the 23ERE clause2
C. #he MRO(: BY clause must contain the group functions used in the
SELECT list2
D. #he 3K1'M clause can contain only the group functions used in
the SELECT list2
18. 1hat will the following S?L statement return?
sele?/ maV!pro.;pa?S;sAUe%
Irom s-.pro.u?/s
,-ere mAn!pro.;,eA@-/;?lass% 0 G;
A. n e3ception will $e raised2
B. #he largest P!O0"P*R"S6NE for rows containing P!O0"
1E6@H#"*LSS of 9 or higher
C. #he largest P!O0"P*R"S6NE for rows containing P!O0"
1E6@H#"*LSS of 9
D. #he largest P!O0"P*R"S6NE in the SH2P!O0&*#S ta$le
19. 1hy will the following query raise an e3ception?
sele?/ .ep/;no, aR@!.As/An?/ salary%
,?oun/!Tob% Tob;?oun/
Irom emp
,-ere m@r lASe WH<>
or abs!salary% 9 1"
-aRAn@ ?oun/!Tob% 9 G
or.er by 2 .es?;
A. #he 3K1'M clause cannot contain a group function2
B. #he MRO(: BY clause is missing2
C. BS!% is not an Oracle function2
D. #he query will not raise an e3ception2
20. 1hat will the @!P column in the following S?L return?
sele?/ sales;rep;A.,sum!or.er;/o/al%
,@roupAn@!sales;rep;A.% @rp
Irom oe.or.ers
@roup by ?ube!sales;rep;A.%
A. #he query will raise an e3ception2
B. #he @!P column will $e a cumulati5e count of SLES"!EP"602
C. #he @!P column will $e a cumulati5e sum of O!0E!"#O#L/
grouped $y SLES"!EP"602
D. #he @!P column will $e a superaggregate identifier2
1. 1hich line of code has an error?
A. SELECT .name, ename
B. FROM emp e, .ep/ .
C. 23ERE emp..ep/no 0 .ep/..ep/no
D. ORDER BY 1, 2;
2. 1hat will $e the result of the following query?
SELECT ?.?us/;A., ?.?us/;name, o.or.;.a/e, o.pro.;A.
FROM ?us/omers ?, or.ers o
23ERE ?.?us/;A. 0 o.?us/;A. !#%;
A. List all the customer names in the *&S#OME!S ta$le and the
orders they made from the O!0E!S ta$le/ e5en if the customer
has not placed an order
B. List only the names of customer from the *&S#OME!S ta$le who
ha5e placed an order in the O!0E!S ta$le
C. List all orders from the O!0E!S ta$le/ e5en if there is no 5alid
customer record in the *&S#OME!S ta$le
D. Bor each record in the *&S#OME!S ta$le/ list the information
from the O!0E!S ta$le
3. #he *&S#OME!S and O!0E!S ta$les ha5e the following data:
SNL9 SELECT $ FROM ?us/omers;
C(ST; C(ST;'ME :3O'E C1TY
EEEEE EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEE EEEEEEEEEEE
"1"1 bra-am Taylor Hr. For/ 2or/-
B"1BJ Be//y Baylor F42EGGGEGGGG Dallas
B"1BG BrAan 7An@ C-A?a@o
SNL9 SELECT $ FROM or.ers;
ORD;DTE :ROD;1D C(ST;1D N('T1TY :R1CE
EEEEEEEEE EEEEEEEEEE EEEEEEE EEEEEEEEEE EEEEEEEEEE
2"EFEBE"" 14J1 B"1BJ G 6G.G
"2EFEBE"" 1""1 B"1BJ 2G 2"6G.5G
"2EFEBE"" 1""1 B"1BG B 2J4.F
1hen the following query is e3ecuted/ what will $e the 5alue of
PROD_ID and ORD_DATE for the customer $raham #aylor Ir2?
SELECT ?.?us/;A., ?.?us/;name, o.or.;.a/e, o.pro.;A.
FROM ?us/omers ?, or.ers o
23ERE ?.?us/;A. 0 o.?us/;A. !#%;
A. '(LL/ -.AI%A-.
B. '(LL/ '(LL
C. .--./ -+ABE'A--
D. #he query will not return customer $raham #aylor Ir2
4. 1hen using %S6 Join synta3/ which clause is used to specify a Join
condition?
A. HO1'
B. (S1'M
C. O'
D. 23ERE
5. #he EMPLOYEES ta$le has EMPLOYEE"60/ 0EP!#ME%#"60/
and B&LL"%ME columns2 #he 0EP!#ME%#S ta$le has
0EP!#ME%#"60 and 0EP!#ME%#"%ME columns2 1hich
two of the following queries return the department 60/ name/ and
employee name/ listing department names e5en if there is no employee
assigned to that department?
A. SELECT ...epar/men/;A., ...epar/men/;name, e.Iull;name
FROM .epar/men/s .
'T(RL LEFT O(TER HO1' employees e;
B. SELECT .epar/men/;A., .epar/men/;name, Iull;name
FROM .epar/men/s
'T(RL LEFT HO1' employees;
C. SELECT ...epar/men/;A., ...epar/men/;name, e.Iull;name
FROM .epar/men/s .
LEFT O(TER HO1' employees e
(S1'M !...epar/men/;A.%;
D. SELECT ...epar/men/;A., ...epar/men/;name, e.Iull;name
FROM .epar/men/s .
LEFT O(TER HO1' employees e
O' !...epar/men/;A. 0 e..epar/men/;A.%;
6. 1hich two operators are not allowed when using an outerAJoin operator in the query?
A. OR
B. 'D
C. 1'
D. 0
7. 1hich two operators are used to add more Joining conditions in a multipleAta$le query?
A. 'OT
B. OR
C. 'D
D. *omma 7,8
8. #he columns of the EMPLOYEES/ 0EP!#ME%#S/ and IO'S ta$les are shown $elow2
1hich assertion a$out the following query is correct?
SELECT e.las/;name, ...epar/men/;name, T.Tob;/A/le
FROM Tobs T
1''ER HO1' employees e
O' !e..epar/men/;A. 0 ...epar/men/;A.%
HO1' .epar/men/s .
O' !T.Tob;A. 0 e.Tob;A.%;
A. #he query returns all the rows from EMPLOYEE ta$le/ where there is
a corresponding record in the IO'S ta$le and 0EP!#ME%#S ta$le2
B. #he query fails with an in5alid column name error2
C. #he query fails $ecause line , specifies 1''ER HO1'/ which is not
a 5alid synta32
D. #he query fails $ecause line 9 does not specify the >eyword 1''ER2
E. #he query fails $ecause the column names are qualified with the
ta$le alias2
Table Column Names Datatype
EMPLOYEE EMPLOYEE"60 %&M'E! 7:8
B6!S#"%ME )!*H!+ 7+98
LS#"%ME )!*H!+ 7+98
SL!Y %&M'E! 7</+8
IO'"60 )!*H!+ 7.-8
M%@E!"60 %&M'E! 7:8
0EP!#ME%#"60 %&M'E! 7+8
DEP!"TMENT 0EP!#ME%#"60 %&M'E! 7+8
0EP!#ME%#"%ME )!*H!+ 7,-8
M%@E!"60 %&M'E! 7:8
LO*#6O%"60 %&M'E! 7(8
#O$ IO'"60 )!*H!+ 7.-8
IO'"#6#LE )!*H!+ 7,-8
9. #he columns of the EMPLOYEES and 0EP!#ME%#S ta$les are
shown in question <2 *onsider the following three queries using those
ta$les2
1. SELECT las/;name, .epar/men/;name
FROM employees e, .epar/men/s .
23ERE e..epar/men/;A. 0 ...epar/men/;A.;
2. SELECT las/;name, .epar/men/;name
FROM employees 'T(RL HO1' .epar/men/s;
B. SELECT las/;name, .epar/men/;name
FROM employees HO1' .epar/men/s
(S1'M !.epar/men/;A.%;
1hich of the following assertions $est descri$es the results?
A. ?ueries ./ +/ and , produce the same results2
B. ?ueries + and , produce the same result4 query . produces a
different result2
C. ?ueries ./ +/ and , produce different results2
D. ?ueries . and , produce the same result4 query + produces a
different result2
10. #he data in the S##E ta$le is as shown:
SNL9 SELECT $ FROM s/a/e;
C'T;CODE ST;CODE ST;'ME
EEEEEEEEEE EEEEEEE EEEEEEEEEEEE
1 TL TELS
1 C CL1FOR'1
F1 T' TM1L 'D(
1 T' TE''ESSE
F1 7L 7ERL
*onsider the following query:
SELECT ?n/;?o.e
FROM s/a/e
23ERE s/;name 0 !SELECT s/;name FROM s/a/e
23ERE s/;?o.e 0 )T')%;
1hich of the following assertions $est descri$es the results?
A. #he query will return the *%#"*O0E for the S#"*O0E
5alue )T')2
B. #he query will fail and will not return any rows2
C. #he query will display . and =. as *%#"*O0E 5alues2
D. #he query will fail $ecause an alias name is not used2
11. #he data in the S##E ta$le is shown in question .-2 #he data in the
*6#Y ta$le is as shown $elow2
SNL9 SELECT $ FROM ?A/y;
C'T;CODE ST CTY;CODE CTY;'ME
EEEEEEEEEE EE EEEEEEEEEE EEEEEEEEEEEEE
1 TL 1""1 DLLS
F1 T' 22JB MDRS
1 C 5"FF LOS 'MELES
1hat is the result of the following query?
SELECT s/;name "S/a/e 'ame"
FROM s/a/e
23ERE !?n/;?o.e, s/;?o.e% 0
!SELECT ?n/;?o.e, s/;?o.e
FROM ?A/y
23ERE ?/y;name 0 )DLLS)%;
A. #EQS
B. #he query will fail $ecause *%#"*O0E and S#"*O0E are not in
the 23ERE clause of the su$query2
C. #he query will fail $ecause more than one column appears in the
23ERE clause2
D. #Q
12. 1hich line of the code $elow has an error?
1 SELECT .epar/men/;A., ?oun/!$%
2 FROM employees
B MRO(: BY .epar/men/;A.
J 3K1'M CO('T!.epar/men/;A.% 0
G !SELECT maV!?oun/!.epar/men/;A.%%
6 FROM employees
4 MRO(: BY .epar/men/;A.%;
A. Line ,
B. Line (
C. Line 9
D. Line ;
E. %o error
13. 1hich query is a correlated su$query?
A. sele?/ ?/y;name Irom ?A/y
,-ere s/;?o.e An !sele?/ s/;?o.e Irom s/a/e
,-ere s/;name 0 )TE''ESSE)
an. ?A/y.?n/;?o.e 0 s/a/e.?n/;?o.e%;
B. sele?/ ?/y;name
Irom ?A/y
,-ere s/;?o.e An !sele?/ s/;?o.e Irom s/a/e
,-ere s/;name 0 )TE''ESSE)%;
C. sele?/ ?/y;name
Irom ?A/y, s/a/e
,-ere ?A/y.s/;?o.e 0 s/a/e.s/;?o.e
an. ?A/y.?n/;?o.e 0 s/a/e.?n/;?o.e
an. s/;name 0 )TE''ESSE);
D. sele?/ ?/y;name
Irom ?A/y, s/a/e
,-ere ?A/y.s/;?o.e 0 s/a/e.s/;?o.e !#%
an. ?A/y.?n/;?o.e 0 s/a/e.?n/;?o.e !#%
an. s/;name 0 )TE''ESSE);
14. #he *O&%#!Y ta$le has the following data:
SNL9 SELECT $ FROM ?oun/ry;
C'T;CODE C'T;'ME CO'T1'E'T
EEEEEEEEEE EEEEEEEEEEEEEEEEE EEEEEEEEEE
1 ('1TED STTES '.MER1C
F1 1'D1 S1
6G S1'M:ORE S1
1hat 5alue is returned from the su$query when you e3ecute the
following?
SELECT C'T;'ME
FROM ?oun/ry
23ERE C'T;CODE 0
!SELECT ML!?n/;?o.e% FROM ?oun/ry%;
A. 6%06
B. :9
C. =.
D. S6%@PO!E
15. 1hich line in the following query contains an error?
1 SELECT .ep/no, ename, sal
2 FROM emp e1
B 23ERE sal 0 !SELECT ML!sal% FROM emp
J 23ERE .ep/no 0 e1..ep/no
G ORDER BY .ep/no%;
A. Line +
B. Line ,
C. Line (
D. Line 9
16. *onsider the following query:
SELECT .ep/no, ename, salary salary, aRera@e,
salaryEaRera@e .AIIeren?e
FROM emp,
!SELECT .ep/no .no, KM!salary% aRera@e FROM emp
MRO(: BY .ep/no%
23ERE .ep/no 0 .no
ORDER BY 1, 2;
1hich of the following statements is correct?
A. #he query will fail $ecause no alias name is pro5ided for the su$query2
B. #he query will fail $ecause a column selected inside the su$query
is referenced outside the scope of the su$query2
C. #he query will wor> without errors2
D. MRO(: BY cannot $e used inside a su$query2
17. #he *O&%#!Y ta$le has the following data:
SNL9 SELECT $ FROM ?oun/ry;
C'T;CODE C'T;'ME CO'T1'E'T
EEEEEEEEEE EEEEEEEEEEEEEEEEEEEE EEEEEEEEEE
1 ('1TED STTES '.MER1C
F1 1'D1 S1
6G S1'M:ORE S1
1hat will $e the result of the following query?
1'SERT 1'TO !SELECT ?n/;?o.e FROM ?oun/ry
23ERE ?on/Anen/ 0 )S1)%
KL(ES !F41, )S(D1 RB1), )S1)%;
A. One row will $e inserted into *O&%#!Y ta$le2
B. 21T3 C3EC7 O:T1O' is missing in the su$query2
C. #he query will fail $ecause the KL(ES clause is in5alid2
D. #he 23ERE clause cannot appear in the su$queries used in 1'SERT
statements2
18. 6n %S6 S?L/ a selfAJoin can $e represented $y using which of the
following? 7*hoose the $est answer28
A. 'T(RL HO1' clause
B. CROSS HO1' clause
C. HO1' .. (S1'M clause
D. HO1' X O' clause
E. ll of the a$o5e
19. *onsider the following queries:
1. SELECT las/;name, salary,
!SELECT !ML!sQ.salary% E e.salary%
FROM employees sQ
23ERE sQ..epar/men/;A. 0 e..epar/men/;A.% DSL
FROM employees e
23ERE .epar/men/;A. 0 2";
2. SELECT las/;name, salary, msalary E salary .sal
FROM employees e,
!SELECT .epar/men/;A., ML!salary% msalary
FROM employees
MRO(: BY .epar/men/;A.% sQ
23ERE e..epar/men/;A. 0 sQ..epar/men/;A.
'D e..epar/men/;A. 0 2";
B. SELECT las/;name, salary, msalary E salary .sal
FROM employees e 1''ER HO1'
!SELECT .epar/men/;A., ML!salary% msalary
FROM employees
MRO(: BY .epar/men/;A.% sQ
O' e..epar/men/;A. 0 sQ..epar/men/;A.
23ERE e..epar/men/;A. 0 2";
J. SELECT las/;name, salary, msalary E salary .sal
FROM employees 1''ER HO1'
!SELECT .epar/men/;A., ML!salary% msalary
FROM employees
MRO(: BY .epar/men/;A.% sQ
(S1'M !.epar/men/;A.%
23ERE .epar/men/;A. 0 2";
1hich of the following assertions $est descri$es the results?
A. ?ueries . and + produce identical results/ and queries , and ( produce
identical results/ $ut queries . and , produce different results2
B. ?ueries ./ +/ ,/ and ( produce identical results2
C. ?ueries ./ +/ and , produce identical results4 query ( will produce
errors2
D. ?ueries . and , produce identical results4 queries + and ( will
produce errors2
E. ?ueries ./ +/ ,/ and ( produce different results2
F. ?ueries . and + are 5alid S?L4 queries , and ( are not 5alid2
20. #he columns of the EMPLOYEES and 0EP!#ME%#S ta$les are
shown in question <2 1hich query will show us the topAfi5e highly
paid employees in the company?
A. SELECT las/;name, salary
FROM employees
23ERE RO2'(M 80 G
ORDER BY salary DESC;
B. SELECT las/;name, salary
FROM !SELECT $
FROM employees
23ERE RO2'(M 80 G
ORDER BY salary DESC %
23ERE RO2'(M 80 G;
C. SELECT $ FROM
!SELECT las/;name, salary
FROM employees
ORDER BY salary%
23ERE RO2'(M 80 G;
D. SELECT $ FROM
!SELECT las/;name, salary
FROM employees
ORDER BY salary DESC%
23ERE RO2'(M 80 G;
1. 5iew created with which option ma>es sure that rows added to the
$ase ta$le through the 5iew are accessi$le to the 5iew?
A. 23ERE
B. 21T3 RED O'LY
C. 21T3 C3EC7 O:T1O'
D. CRETE OR RE:LCE K1E2
2. 5iew is created using the following code2 1hat operations are permitted on the 5iew?
CRETE K1E2 (S;STTES S SELECT $ FROM STTE
23ERE C'T;CODE 0 1
21T3 RED O'LY;
A. SELECT
B. SELECT/ (:DTE
C. SELECT/ DELETE
D. SELECT/ 1'SERT
3. How do you remo5e the 5iew &S"S##ES from the schema?
A. LTER K1E2 (S;STTES REMOKE;
B. DRO: K1E2 (S;STTES;
C. DRO: K1E2 (S;STTES CSCDE;
D. DRO: (S;STTES;
4. 1hich data dictionary 5iew has information on the columns in a 5iew
that are updata$le?
A. &SE!")6E1S
B. &SE!"&P0#'LE"*OL&M%S
C. &SE!"*OL&M%S
D. &SE!"*OL&M%S"&P0#'LE
5. 1hich option in 5iew creation creates a 5iew e5en if there are
synta3 errors?
A. CRETE FORCE K1E2X
B. CRETE OR RE:LCE K1E2X
C. CRETE OR RE:LCE K1E2 FORCEX
D. CRETE K1E2 X 1M'ORE ERRORS
6. 6n a Join 5iew/ on how many $ase ta$les can you perform a 0ML
operation 7(:DTED1'SERTDDELETE8 in a single step?
A. One
B. #he num$er of $ase ta$les in the 5iew definition
C. #he num$er of $ase ta$les minus one
D. %one
7. #he following code is used to define a 5iew2 #he EMP ta$le does not
ha5e a primary >ey or any other constraints2
CRETE K1E2 MYK1E2 S
SELECT D1ST1'CT E'ME, SLRY
FROM EM:
23ERE DE:T;1D 0 1";
1hich operations are allowed on the 5iew?
A. SELECT/ 1'SERT/ (:DTE/ DELETE
B. SELECT/ (:DTE
C. SELECT/ 1'SERT/ DELETE
D. SELECT
E. SELECT/ (:DTE/ DELETE
8. 1hich two statements are used to modify a 5iew definition?
A. LTER K1E2
B. CRETE OR RE:LCE K1E2
C. RE:LCE K1E2
D. CRETE FORCE K1E2
E. CRETE OR RE:LCE FORCE K1E2
9. You create a 5iew $ased on the EMPLOYEES ta$le using the
following S?L2
CRETE K1E2 MYK1E2 S SELECT $ FROM EM:LOYEES;
You modify the ta$le to add a column named EMP"SS%2 1hat do you
need to do to ha5e this new column appear in the 5iew?
A. %othing/ since the 5iew definition is selecting all columns/ the new
column will appear in the 5iew automatically2
B. !ecompile the 5iew using LTER K1E2 MYK1E2 RECOM:1LE2
C. !eAcreate the 5iew using CRETE OR RE:LCE K1E22
D. dd the column to the 5iew using LTER K1E2 MYK1E2 DD
EM:;SS'2
10. You can 5iew the constraints on the o$Jects in your schema in the
&SE!"*O%S#!6%#S dictionary 5iew2 #he *O%S#!6%#"#YPE
column shows the type of constraint2 1hat is the type of constraint
created when you create a 5iew with the 21T3 C3EC7 O:T1O' clause?
A. !
B. *
C. )
D. B
11. 1hich types of constraints can $e created on a 5iew?
A. *hec>/ 'OT '(LL
B. Primary >ey/ foreign >ey/ unique >ey
C. *hec>/ 'OT '(LL/ primary >ey/ foreign >ey/ unique >ey
D. %o constraints can $e created on a 5iew2
12. 1hich is a 5alid status of a constraint created on a 5iew?
A. D1SBLE KL1DTE
B. D1SBLE 'OKL1DTE
C. E'BLE 'OKL1DTE
D. ll of the a$o5e
13. #he SL!Y column of the EMPLOYEE ta$le is defined as %&M'E!
7</+8/ and the *OMM6SS6O%"P*# column is defined as %&M'E!7
+/+82 5iew is created with the following code2
CRETE K1E2 EM:;COMM S
SELECT LST;'ME,
SLRY $ 'KL!COMM1SS1O';:CT,"% CommAssAon
FROM EM:LOYEES;
1hat is the datatype of the *OMM6SS6O% column in the 5iew?
A. %&M'E! 7</+8
B. %&M'E! 7.-/+8
C. %&M'E!
D. BLO#

14. 1hich clause in the SELECT statement is not supported in a 5iew definition su$query?
A. MRO(: BY
B. 3K1'M
C. C(BE
D. FOR (:DTE OF
E. ORDER BY
15. #he EMPLOYEE ta$le has the following columns:
EM:;1D '(MBER !J%
EM:;'ME KRC3R2 !B"%
SLRY '(MBER !G,2%
DE:T;1D KRC3R2 !2%
1hich query will show the topAfi5e highest paid employees?
A. SELECT $ FROM
!SELECT EM:;'ME, SLRY
FROM EM:LOYEES
ORDER BY SLRY SC%
23ERE RO2'(M 80 G;
B. SELECT EM:;'ME, SLRY FROM
!SELECT $
FROM EM:LOYEES
ORDER BY SLRY DESC%
23ERE RO2'(M 8 G;
C. SELECT $ FROM
!SELECT EM:;'ME, SLRY
FROM EM:LOYEES
ORDER BY SLRY DESC%
23ERE RO2'(M 80 G;
D. SELECT EM:;'ME, SLRY
!SELECT $
FROM EM:LOYEES
ORDER BY SLRY DESC%
23ERE RO2'(M 0 G;
16. #he EMPLOYEE ta$le has the following columns:
EM:;1D '(MBER !J% :R1MRY 7EY
EM:;'ME KRC3R2 !B"%
SLRY '(MBER !G,2%
DE:T;1D KRC3R2 !2%
17. #o $e a$le to modify a Join 5iew/ the 5iew definition should not contain
which of the following in the topAle5el query? 7*hoose all that apply28
A. D1ST1'CT operator
B. ORDER BY clause
C. ggregate functions such as S(M/ KM/ and CO('T
D. 23ERE clause
E. MRO(: BY clause
F. RO2'(M pseudoAcolumn
18. 1hat is an inline 5iew?
A. su$query appearing in the 23ERE clause
B. su$query appearing in the FROM clause
C. 5iew created using the same column names of the $ase ta$le
D. 5iew created with an ORDER BY clause
19. 1hich of the following two statements are true?
A. 5iew can $e created $efore creating the $ase ta$le2
B. 5iew cannot $e created $efore creating the $ase ta$le2
C. 5iew will $ecome in5alid if the $ase ta$leKs column referred to in the 5iew is altered2
D. 5iew will $ecome in5alid if any column in the $ase ta$le is altered2
20. 1hich pseudoAcolumn 7with an inline 5iew8 can $e used to get the topAn rows from a ta$le?
A. RO21D
B. RO2;1D
C. RO2'(M
D. RO2;'(M

You might also like