You are on page 1of 4

Oracle workshop

By Krishna Reddy
1) Updating a Primary key value will be allowed by Oracle when it has
dependent records.
A)True B)alse !)"one
#)The $$$$$$$$$ allows %or automatic make it null value o% child record when
a parent record
is deleted.
A) Add constraint B)&rop !onstraint !)On delete cascade &)"one
') Evaluate the SQL statement
DROP TBLE DEPT!
"hich #our statements are true o# the SQL statement$ %&hoose #our'

( )ou cannot roll *ack this statement(
B( ll pendin+ transactions are committed(
&( ll views *ased on the DEPT ta*le are deleted(
D( ll inde,es *ased on the DEPT ta*le are dropped(
E( ll data in the ta*le is deleted- and the ta*le structure is also
deleted(
.( ll data in the ta*le is deleted- *ut the structure o# the ta*le is
retained(
/( ll synonyms *ased on the DEPT ta*le are deleted(
0' 1create ta*le emp
%empno num*er constraint pk2eno primary key-
ename varchar3%34''5
1 create ta*le incr
%empno num*er constraint #k2eno re#erences emp%empno'-
Doi date-iamt num*er'5
1 insert into emp values%6743-89:8'50
1 insert into incr values%6743-;<3=>an=<<;-344'5
< row created(
SQL1 alter ta*le emp rename column rename empno to emp2num*er5
SQL1 rename emp to employee5
?' (ou need to modi%y the )TU&*"T) table to add a primary key on the
)TU&*"T$+& column.
The table is currently empty.
,hich statement accomplishes this task-

A. A.T*/ TAB.* students A&& P/+0A/( 1*( student$id2
B. A.T*/ TAB.* students A&& !O")T/A+"T P/+0A/( 1*( 3student $ id)2
!. A.T*/ TAB.* students A&& !O")T/A+"T stud$id$pk P/+0A/( 1*( 3student
$ id)2
&. A.T*/ TAB.* students A&& student $ id !O")T/A+"T stud $ id $pk
P/+0A/( 1*(2
*. A.T*/ TAB.* students 0O&+( !O")T/A+"T stud $ id $pk
P/+0A/( 1*( 3student $ id)2
@' or which two constraints does the Oracle )erver implicitly create a uni4ue inde5-
3!hoose two.)

A. "OT "U.. B. P/+0A/( 1*( !. O/*+6" 1*( &. !7*!1 *. U"+8U*
9) ,hich synta5 turns an e5isting constraint on-
A. A.T*/ TAB.* table$name *"AB.* constraint$name2
B.A.T*/ TAB.* table$name )TATU) : *"AB.* !O")T/A+"T constraint $
DURGA SOFTWARE SOLUTIONS, S.R.NAGAR, HYDERABAD-38. Cell: 92462243
name2
!. A.T*/ TAB.* table$name *"AB.* !O")T/A+"T constraint $ name2
&. A.T*/ TAB.* table$name )TATU) : *"AB.* !O")T/A+"T constraint $
name2
*. A.T*/ TAB.* table$name TU/" O" !O")T/A+"T constraint $ name2
. A.T*/ TAB.* table$name TU/" O" !O")T/A+"T constraint $ name2
;) ,hich )8. statement de%ines the O/*+6" 1*( constraint on the
&*PT"O column o% the *0P table-

A.) !/*AT* TAB.* *0P
3empno "U0B*/3<)=
ename >A/!"A/#3'?)=
deptno "U0B*/39=#) "OT "U..
!O")T/A+"T emp$deptno$%k O/*+6" 1*( deptno /**/*"!*) dept
deptno)2
B) !/*AT* TAB.* *0P
3empno "U0B*/3<)=
ename >A/!"A/#3'?)=
deptno "U0B*/39=#)
!O")T/A+"T emp$deptno$%k /**/*"!*) dept 3deptno))2
!) !/*AT* TAB.* *0P
3empno "U0B*/3<)
ename >A/!7A/#3'?)=
deptno "U0B*/39=#) "OT "U..=
!O")T/A+"T emp$deptno$%k /**/*"!*) dept 3deptno) O/*+6"
1*( 3deptno))2
&. !/*AT* TAB.* *0P
3empno "U0B*/3<)=
ename >A/!"A/#3'?)=
deptno "U0B*/39=#) O/*+6" 1*(
!O")T/A+"T emp deptno %k /**/*"!*) dept 3deptno))2
@) ,hen disable the primary key respected inde5 will$$$$$$$$$
A) /emoved B) &isable !) +nactive &)"one
1A) &*AU.T option can be de%ined at Table .evel.
A )TrueB)alse!)"one
11) Y!" #ee$ %! $&'(l)* e+(l!*ee' ,-! -).e #!% /ee# )''&0#e$ %! )#* $e()1%+e#%.
Y!" ,1&%e %-e SELECT '%)%e+e#%:
2'ele3% e#)+e,')l,$e(%#! 41!+ e+(
,-e1e $e(%#! 5#"ll6
)7 T-e S8L '%)%e+e#% $&'(l)* %-e $e'&1e$ 1e'"l%.
/7 T-e 3!l"+# &# %-e WHERE 3l)"'e '-!"l$ /e 3-)#0e$ %! $&'(l)* %-e $e'&1e$ 1e'"l%.
37 T-e !(e1)%!1 &# %-e WHERE 3l)"'e '-!"l$ /e 3-)#0e$ %! $&'(l)* %-e $e'&1e$ 1e'"l%.
$7 T-e WHERE 3l)"'e '-!"l$ /e 3-)#0e$ %! "'e )# !"%e1 9!&# %! $&'(l)* %-e $e'&1e$ 1e'"l%.
1#),hich a valid table name-
A. *0PB$TAB B. *0PC$TAB !.D*0P$TAB &. *0P$&*.*T*
1') or which action can you use the TO$&AT* %unction-

A. !onvert any date literal to a date
B. !onvert any numeric literal to a date
!. !onvert any character literal to a date
&. !onvert any date to a character literal
DURGA SOFTWARE SOLUTIONS, S.R.NAGAR, HYDERABAD-38. Cell: 92462243
*. ormat E1AFGA"F@@E to EGanuary 1A 1@@@E
1<) *5amine the structure o% the H tableI
*0P.O(**$+& "U0B*/ Primary 1ey
+/)T$"A0* >A/!7A/#3#?)
.A)T$"A0* >A/!7A/#3#?)
7+/*$&AT* &AT*
,hich +")*/T statement is invalid-

A. +")*/T +"TO employees 3employee$id= %irst$name= last$name= hire$date)
>A.U*) 31AAA= EGohnE= EsmithE=EA1HA1HA1J)2
B. +")*/T +"TO employees3employee$id= %irst$name= last$name= hire$date)
>A.U*) 31AAA= EGohnE= EsmithE=EA1 Kanuary A1E)2
!.+")*/T +"TO employees1 3employee$id= %irst$name= last$name= hire$date)
>A.U*) 31AA'= EGohnE= EsmithE=to$date3EA1FA1FA1E))
&. +")*/T +"TO employees3employee$id= %irst$name= last$name= hire$date)
>A.U*) 31AAA= EGohnE= EsmithE=EA1FGanFA1E)2
1?) *5amine the structure o% the *0P.O(**) tableI
*0P.O(**$+& "U0B*/ Primary 1ey
+/)T$"A0* >A/!7A/# 3#?)
.A)T$"A0* >A/!7A/# 3#?)
7+/*$&AT* &AT*
,hich UP&AT* statement is valid-

A. UP&AT* employees
)*T %irst$name : EGohnE
)*T last$name : E)mithE
,7*/* employee$id : 1;A2
B. UP&AT* employees
)*T %irst$name : EGohnE=
)*T last$name : E)mithE
,7*/* employee$id : 1;A2

!. UP&AT* employee
)*T %irst$name : EGohnE
A"& last$name : E)mithE
,7*/* employee$id : 1;A2
&. UP&AT* employee
)*T %irst$name : EGohnE= last$name : E)mithE
,7*/* employee$id : 1;A2
1L) From SQL*Plus, you issue this SELECT statement:
SELECT* FROM order;
You use this statement to retriee data !rom a data ta"le !or ##########$ %Choose all that a&&ly'
($ )&datin* +$ ,ie-in* C$ .eletin* .$ /nsertin* E$ Trun0atin*
19) "hich #our statements correctly descri*e #unctions that are availa*le in
SQL$ %&hoose #our'

( A:STR returns the numeric position o# a named character(
B( :BL3 returns the #irst non=null e,pression in the e,pression
list(
&( TRC:&TE rounds the column- e,pression- or value to n
decimal places(
D( DE&ODE translates an e,pression a#ter comparin+ it to each
search value(
E( TRAD trims the headin+ o# trailin+ characters %or *oth' #rom a
character strin+(
DURGA SOFTWARE SOLUTIONS, S.R.NAGAR, HYDERABAD-38. Cell: 92462243
.( :BL compares two e,pressions and returns null i# they are
eEual- or the #irst e,pression o# they are not eEual(
/( :CLLA. compares twp e,pressions and returns null i# they are
eEual- or the #irst e,pression i# they are not eEual(
1;)*valuate the )8. statementI
)*.*!T .PA& 3salary=1A=M)
/O0 *0P
,7*/* *0P $ +& : 1AA12
+% the employee with the *0P$+& 1AA1 has a salary o% 19AAA= what is
displayed-

A. 19AAA.AA B. 19AAAMMMMM !. MMMM19A.AA &. MM19AAA.AA
*."one
1@) *5amine the structure o% the *0P.O(**) and "*,$*0P.O(**) tablesI
*0P.O(**)
*0P.O(**$+& "U0B*/ Primary 1ey
+/)T$"A0* >A/!7A/#3#?)
.A)T$"A0* >A/!7A/#3#?)
7+/*$&AT* &AT*
"*,$*0P.O(**)
*0P.O(**$+& "U0B*/ Primary 1ey
"A0* >A/!7A/# 3LA)
,hich &*.*T* statement is valid-
A. &*.*T* /O0 employees
,7*/* employee$id : 3)*.*!T employee$id /O0 employees)2
B. &*.*T* M /O0 employees
,7*/* employee$id : 3)*.*!T employee$id /O0 new$ employees)2
!. &*.*T* /O0 employees
,7*/* employee$id +" 3)*.*!T employee$id
/O0 new$employees
,7*/* name : EcarreyE)2
&. &*.*T* M /O0 employees
,7*/* employee$id +" 3)*.*!T employee$id
/O0 new$employees
,7*/* name : EcarreyE)2
#A) )elect employee name whose Kob is 0anager or !lerk and
)alary greater than 1AAA and commission greater than 1AA and deptno is
either 1A or #A.
A. select ename %rom emp
where Kob in3E0A"A6*/E=E!.*/1E) A"& )A. N1AAA A"& !O00N1AA
A"& &*PT"O:31A=#A)2
B. )elect ename %rom emp
where Kob in3E0A"A6*/EO/ E!.*/1E) A"& )A. N1AAA
A"& !O00N1AA A"& &*PT"O +"31A=#A)2
!. )elect ename %rom emp
where Kob in3E0A"A6*/E=E!.*/1E)
A"& )A. N1AAA A"& !O00N1AA
A"& &*PT"O +"31A=#A)2
&. "one
DURGA SOFTWARE SOLUTIONS, S.R.NAGAR, HYDERABAD-38. Cell: 92462243

You might also like