Sie sind auf Seite 1von 9

Name:

Date:
Department:
QUESTION NO: 1
Examine the structure of the EMPLOYEES table:
EMPLOYEE_ID NUMBER Primary Key
FIRST_NAME VARCAR!"!#$
LAST_NAME VARCAR!"!#$
hich three statements inserts a ro! into the table" #$hoose three%
A% INSERT INTO emp&'yee(
VALUES " NULL) *+',n-)*Smit,-$.
B% INSERT INTO emp&'yee(" /ir(t_name) &a(t_name$
VALUES"*+',n-)*Smit,-$.
C% INSERT INTO emp&'yee(
VALUES "*0111-)*+',n-)NULL$.
D% INSERT INTO emp&'yee("/ir(t_name)&a(t_name) emp&'yee_i2$
VALUES " 0111) *+',n-)*Smit,-$.
E% INSERT INTO emp&'yee( "emp&'yee_i2$
VALUES "0111$.
F% INSERT INTO emp&'yee( "emp&'yee_i2) /ir(t_name) &a(t_name$
VALUES " 0111) *+',n-)*-$.
a$ A) C) D
3$ B) C) F
4$ C) D) F
2$ C) E) F
QUESTION NO: &
Examine the 'escri(tion of the EMPLOYEES table:
EMP_ID NUMBER"5$ NOT NULL
LAST_NAME VARCAR!"61$ NOT NULL
FIRST_NAME VARCAR!"61$
DEPT_ID NUMBER"!$
+OB_CAT VARCARD!"61$
SALARY NUMBER"7)!$
hich statement sho!s the maximum salar) (ai' in each *ob cate+or) of each
'e(artment"
A% SELECT 2ept_i2) 8'3_4at) MA9"(a&ary$
FROM emp&'yee(
:ERE (a&ary ; MA9"(a&ary$.
B% SELECT 2ept_i2) 8'3_4at) MA9"(a&ary$
FROM emp&'yee(
<ROUP BY 2ept_i2) 8'3_4at.
C% SELECT 2ept_i2) 8'3_4at) MA9"(a&ary$
FROM emp&'yee(.
D% SELECT 2ept_i2) 8'3_4at) MA9"(a&ary$
FROM emp&'yee(
<ROUP BY 2ept_i2.
E% SELECT 2ept_i2) 8'3_4at) MA9"(a&ary$
FROM emp&'yee(
<ROUP BY 2ept_i2) 8'3_4at) (a&ary.
QUESTION NO: ,
Examine the 'ata in the EMPLOYEES an' -EP./TMENTS tables0
EMPLOYEES
LAST_NAME DEPARTMENT_ID SALARY
Getz 10 3000
Davis 20 1500
King 20 2200
Davis 30 5000
Koca! 5000
DEPARTMENTS
DEPARTMENT_ID DEPARTMENT_NAME
10 Sa#es
20 Ma!$eting
30 Acco%nts
&0 A'(inist!ation
You !ant to retrie1e all em(lo)ees2 !hether or not the) ha1e matchin+ 'e(artments in
the 'e(artments table0 hich 3uer) !oul' )ou use"
A% SELECT &a(t_name) 2epartment_name
FROM emp&'yee( ) 2epartment("=$.
B% SELECT &a(t_name) 2epartment_name
FROM emp&'yee( +OIN 2epartment( "=$.
C% SELECT &a(t_name) 2epartment_name
FROM emp&'yee("=$ e +OIN 2epartment( 2
ON "e%2epartment_i2 > 2%2epartment_i2$.
D% SELECT &a(t_name) 2epartment_name
FROM emp&'yee( e
RI<T OUTER +OIN 2epartment( 2 ON "e%2epartment_i2 > 2%2epartment_i2$.
E% SELECT &a(t_name) 2epartment_name
FROM emp&'yee("=$ ) 2epartment(
ON "e%2epartment_i2 > 2%2epartment_i2$.
F% SELECT &a(t_name) 2epartment_name
FROM emp&'yee( e LEFT OUTER
+OIN 2epartment( 2 ON "e%2epartment_i2 > 2%2epartment_i2$.
QUESTION NO: 4
You nee' to +i1e the M.N.5E/ role the abilit) to select from2 insert into2 an' mo'if) existin+ ro!s
in the STU-ENT65/.-ES table0 .n)one +i1en this M.N.5E/ role shoul' be able to (ass those
(ri1ile+es on to others0
hich statement accom(lishes this?
A% <RANT (e&e4t) in(ert) @p2ate
ON (t@2ent_Ara2e(
TO manaAer.
B% <RANT (e&e4t) in(ert) @p2ate
ON (t@2ent_Ara2e(
TO ROLE manaAer.
C% <RANT (e&e4t) in(ert) m'2i/y
ON (t@2ent_Ara2e(
TO manaAer
:IT <RANT OPTION.
D% <RANT (e&e4t) in(ert) @p2ate
ON (t@2ent_Ara2e(
TO manaAer
:IT <RANT OPTION.
E% <RANT (e&e4t) in(ert) @p2ate
ON (t@2ent_Ara2e(
TO ROLE manaAer
:IT <RANT OPTION.
F% <RANT (e&e4t) in(ert) m'2i/y
ON (t@2ent_Ara2e(
TO ROLE manaAer
:IT <RANT OPTION.
QUESTION NO: 7
hich statement ex(licitl) names a constraint"
A% ALTER TABLE (t@2ent_Ara2e(
ADD
FOREI<N KEY "(t@2ent_i2$ REFERENCES (t@2ent("(t@2ent_i2$.
B% ALTER TABLE (t@2ent_Ara2e(
ADD CONSTRAINT NAME > (t@2ent_i2_/B
FOREI<N KEY "(t@2ent_i2$ REFERENCES (t@2ent("(t@2ent_i2$.
C% ALTER TABLE (t@2ent_Ara2e(
ADD CONSTRAINT (t@2ent_i2_/B
FOREI<N KEY "(t@2ent_i2$ REFERENCES (t@2ent("(t@2ent_i2$.
D% ALTER TABLE (t@2ent Ara2e(
ADD NAMED CONSTRAINT (t@2ent_i2_/B
FOREI<N KEY "(t@2ent_i2$ REFERENCES (t@2ent("(t@2ent_i2$.
E% ALTER TABLE (t@2ent Ara2e(
ADD NAME (t@2ent_i2_/B
FOREI<N KEY "(t@2ent_i2$ REFERENCES (t@2ent("(t@2ent_i2$.
QUESTION NO: 8
In !hich scenario !oul' in'ex be most useful"
A% T,e in2eCe2 4'&@mn i( 2e4&are2 a( NOT NULL%
B% T,e in2eCe2 4'&@mn( are @(e2 in t,e FROM 4&a@(e%
C% T,e in2eCe2 4'&@mn( are part '/ an eCpre((i'n%
D% T,e in2eCe2 4'&@mn 4'ntain( a Di2e ranAe '/ Ea&@e(%
QUESTION NO: 9
Examine the 'ata from the O/-E/S an' $USTOME/S table0
ORDERS
)RD_ID )RD_DATE *+ST_ID )RD_T)TAL
100 12,-an,2000 15 10000
101 .,Ma!,2000 &0 /000
102 .,Ma!,2000 35 12500
103 15,Ma!,2000 15 12000
10& 25,-%n,2000 15 0000
105 1/,-%#,2000 20 5000
100 1/,-%#,2000 35 1000
101 21,-%#,2000 20 0500
10/ &,A%g,2000 10 /000
CUSTOMERS
*+ST_ID *+ST_NAME *ITY
10 S(it Los Ange#es
15 2o3 San 4!ancisco
20 Ma!tin *icago
25 Ma!5 Ne6 Yo!$
30 Rina *icago
35 S(it Ne6 Yo!$
&0 Lin'a Ne6 Yo!$
hich SQL statement retrie1es the or'er I-2 customer I-2 an' or'er total for the
or'ers that are (lace' on the same 'a) that Martin (laces his or'ers"
A% SELECT 'r2_i2) 4@(t_i2) 'r2_t'ta&
FROM 'r2er() 4@(t'mer(
:ERE 4@(t_name>-MatinA-
AND 'r2_2ate IN "-07F+ULF!111-)-!0F+ULF!111-$.
B% SELECT 'r2_i2) 4@(t_i2) 'r2_t'ta&
FROM 'r2er(
:,ere 'r2_2ate IN "SELECT 'r2_2ate
FROM 'r2er(
:ERE 4@(t_i2 > "SELECT 4@(t_i2
FROM 4@(t'mer(
:ERE 4@(t_name >
*Martin-$$.
C% SELECT 'r2_i2) 4@(t_i2) 'r2_t'ta&
FROM 'r2er(
:,ere 'r2_2ate IN "SELECT 'r2_2ate
FROM 'r2er() 4@(t'mer(
:,ere 4@(t_name > *Martin-$.
D% SELECT 'r2_i2) 4@(t_i2) 'r2_t'ta&
FROM 'r2er(
:ERE 4@(t_i2 IN "SELECT 4@(t_i2
FROM 4@(t'mer(
:ERE 4@(t name > *Martin-$.
QUESTION NO: :
Examine this co'e:
CREATE OR REPLACE PACKAGE bonus
IS
g_max_bonus NUMBER := .99
!UNCTION "a#"_bonus $%_&m%_'( NUMBER)
RETURN NUMBER
!UNCTION "a#"_sa#a*+ $%_&m%_'( NUMBER)
RETURN NUMBER
EN,
-
CREATE OR REPLACE PACKAGE BO,. bonus
IS
/_sa#a*+ &m%#o+&&s.sa#a*+0T.PE
/_bonus &m%#o+&&s."omm'ss'on_%"10T.PE
!UNCTION "a#"_bonus $%_&m%_'( NUMBER)
RETURN NUMBER
IS
BEGIN
SELECT sa#a*+2 "omm'ss'on_%"1
INTO /_sa#a*+2 /_bonus
!ROM &m%#o+&&s
34ERE &m%#o+&&_'( = %_&m%_'(
RETURN /_bonus 5 /_sa#a*+
EN, "a#"_bonus
!UNCTION "a#"_sa#a*+ $%_&m%_'( NUMBER)
RETURN NUMBER
IS
BEGIN
SELECT sa#a*+2 "omm'ss'on_%"1
INTO /_sa#a*+2 /_bonus
!ROM &m%#o+&&s
34ERE &m%#o+&&s
RETURN /_bonus 5 /_sa#a*+ 6 /_sa#a*+
EN, "a"#_sa#a*+
EN, bonus
-
hich statement is true"
A% Y'@ 4an 4a&& t,e BONUS.CALC_SALAR. pa4BaAe2 /@n4ti'n /r'm an INSERT 4'mman2 aAain(t t,e
EMPLO.EES ta3&e%
B% Y'@ 4an 4a&& t,e BONUS.CALC_SALAR. pa4BaAe2 /@n4ti'n /r'm a SELECT 4'mman2 aAain(t t,e
EMPLO.EES ta3&e%
C% Y'@ 4an 4a&& t,e BONUS.CALC_SALAR. pa4BaAe2 /@n4ti'n /'rm a ,ELETE 4'mman2 aAain(t t,e
EMPLO.EES ta3&e%
D% Y'@ 4an 4a&& t,e BONUS.CALC_SALAR. pa4BaAe2 /@n4ti'n /r'm an UP,ATE 4'mman2 aAain(t t,e
EMPLO.EES ta3&e%
QUESTION NO: ;
You nee' to create a tri++er on the EMP table that monitors e1er) ro! that is chan+e' an' (laces
this information into the AUDIT_TABLE0
hat t)(e of tri++er 'o )ou create"
A% !OR EAC4 RO3 triAAer 'n t,e EMP ta3&e%
B% StatementF&eEe& triAAer 'n t,e EMP ta3&e%
C% !OR EAC4 RO3 triAAer 'n t,e AU,IT_TABLE ta3&e%
D% StatementF&eEe& triAAer 'n t,e AU,IT_TABLE ta3&e%
E% !OR EAC4 RO3 (tatementF&eEe& triAAer 'n t,e EMP ta3&e%
QUESTION NO: 1<
Examine this (roce'ure:
CREATE OR REPLACE PROCE,URE A,,_PLA.ER
$7_I, IN NUMBER2 7_LAST_NAME 7ARC4AR8)
IS
BEGIN
INSERT INTO PLA.ER $I,2LAST_NAME)
7ALUES $7_I,2 7_LAST_NAME)
COMMIT
EN,
This (roce'ure must in1o=e the APD_BAT_STAT (roce'ure an' (ass a (arameter0
hich statement2 !hen a''e' to the abo1e (roce'ure !ill successfull) in1o=e the
UPD_BAT_STAT (roce'ure"
A% E9ECUTE UP,_BAT_STAT$7_I,)
B% UP,_BAT_STAT$7_I,)
C% RUN UP,_BAT_STAT$7_I,)
D% START UP,_BAT_STAT$7_I,)
QUESTION NO: 11
Examine this co'e:
CREATE OR REPLACE TRIGGER u%(a1&_&m%
A!TER UP,ATE ON &m%
BEGIN
INSERT INTO au('1_1ab#& $:;o2 (a1&()
7ALUES $USER2 S.S,ATE)
EN,
You issue an UPDATE comman' in the EMP table that results in chan+in+ 1< ro!s0
>o! man) ro!s are inserte' into the AUDIT_TABLE"
A% 0
B% 01
C% N'ne
D% A Ea&@e eG@a& t' t,e n@m3er '/ r'D( in t,e EMP ta3&e%
QUESTION NO: 1&
hich t!o statements about (ac=a+es are true" #$hoose t!o%
A% B't, t,e (pe4i/i4ati'n an2 3'2y are reG@ire2 4'mp'nent( '/ a pa4BaAe%
B% T,e pa4BaAe (pe4i/i4ati'n i( 'pti'na&) 3@t t,e pa4BaAe 3'2y i( reG@ire2%
C% T,e pa4BaAe (pe4i/i4ati'n i( reG@ire2) 3@t t,e pa4BaAe 3'2y i( 'pti'na&%
D% T,e (pe4i/i4ati'n an2 3'2y '/ t,e pa4BaAe are (t're2 t'Aet,er in t,e 2ata3a(e%
E% T,e (pe4i/i4ati'n an2 3'2y '/ t,e pa4BaAe are (t're2 (eparate&y in t,e 2ata3a(e%
a$ A) E
3$ B) D
4$ C) D
2$ C) E
QUESTION NO: 1,
You nee' to remo1e the 'atabase tri++er BUSINESS_HOUR0
hich comman' 'o )ou use to remo1e the tri++er"
A% ,ROP TRIGGER bus'n&ss_;ou*
B% ,ELETE TRIGGER bus'n&ss_;ou*
C% REMO7E TRIGGER bus'n&ss_;ou*
D% ALTER TRIGGER bus'n&ss_;ou* REMO7E
E% ,ELETE !ROM USER_TRIGGERS
34ERE TRIGGER_NAME = <BUSINESS_4OUR=
QUESTION NO: 14
hich one of the follo!in+ is NOT =e)!or' or reser1e' !or' in ?a1a"
a$ i/
3$t,en
4$A't'
2$D,i&e
e$ 4a(e
QUESTION NO: 17
You want to know the amount of free space on the partition containing the users home directory. Which
of the following will you provide with this information?
a7 '8 9o(e
37 '8 :i9o(e
c7 '8 :s5nc
'7 '8 ,T
QUESTION NO: 18
Which of the following commands will make your home directory your working directory?
a7 c'
37 c' o(e
c7 c' ;;
'7 c' o(e9%se!na(e
QUESTION NO: 19
Loo= at the result belo! an' ans!er the follo!in+ three 3uestions;
-rw-r--r-- 2 tb00029 staff 74 Dec 26 16:50 a
-rw-r--r-- 1 tb00029 staff 0 Dec 26 16:50 b
drwxr-xr-x 2 tb00029 staff 512 Dec 26 16:50 c
-rw-r--r-- 2 tb00029 staff 74 Dec 26 16:50 d
lrwxrwxrwx 1 tb00029 staff 1 Dec 26 16:51 e -> c
<ic co((an' (a5 ave =!o'%ce' tese #ines>
?a7 ls -pe
?37 ls -al
?c7 ls -pl
?'7 ls -l
QUESTION NO: 1:
@no!in+ the follo!in+ result:
echo Aabc BenterC
Tue -ec &9 17:17:79 NDT &<<7
hich comman' !as use' to initialise the 1ariable EabcF !ith bash or @orn shell"
"a$ (et a34>2ate
"3$ a34>H"2ate$
"4$ a34>eCe4"2ate$
"2$ Ha34>"2ate$
QUESTION NO: 1
Which command permits to select from the file of users! those working in either ksh or csh?
"ake use of the following file content;
> cat p
tb00029:!:202:1:Eric:/home/tb00029:/usr/bin/ksh
tb00041:!:448:1:Peter:/home/tb00041:/usr/bin/bash
student1:!:297:103:Student 1:/opt/bmc/pem/u/student1:/usr/bin/csh
student2:!:298:103:Student 2:/opt/bmc/pem/u/student2:/usr/bin/csh
team00:!:203:205:Student 00:/home/curaix/team00:/usr/bin/ksh
team01:!:204:205:Student 01:/home/curaix/team01:/usr/bin/ksh
;;;;; !es%#t o8 te co((an' ;;;
tb00029:!:202:1:Eric:/home/tb00029:/usr/bin/ksh
student1:!:297:103:Student 1:/opt/bmc/pem/u/student1:/usr/bin/csh
student2:!:298:103:Student 2:/opt/bmc/pem/u/student2:/usr/bin/csh
team00:!:203:205:Student 00:/home/curaix/team00:/usr/bin/ksh
team01:!:204:205:Student 01:/home/curaix/team01:/usr/bin/ksh
?a7 grep '/ksh' p ; grep '/csh' p
?37 grep '/ksh' p | grep '/csh'
?c7 grep '[kc]sh^' p
?'7 grep '/[kc]sh$' p
#uestion NO: $%
@aving 8o##o6ing !eA%i!e(entsB (a$e seve!a# test cases to va#i'ate te(C
ReA%i!e(entC DD In a 6e3 3ase' a==#icationB te ESea!cF (o'%#e (%st 'is=#a5 (aGi(%( 10 sea!c
!es%#ts =e! =age; Yo% (%st 3e a3#e to sea!c 8o! #ette!sB n%(3e!sB H_H an' H,H; Yo% (%st N)T 3e a3#e
to sea!c 8o! HIHB HJH o! 3#an$; KK
Test Desc!i=tionC so!t 'esc!i=tion o8 te 8eat%!e9ite( to 3e teste'
Test Ste=1 So!t 'esc!i=tion o8 te action to 3e
=e!8o!(e'
So!t 'esc!i=tion o8 te eG=ecte'
!es%#t o8 te action =e!8o!(e'
Test Ste=2 ;;;;;;;;;
;;;;;;;;;
Test Ste= n ;;;;;;;

Das könnte Ihnen auch gefallen