You are on page 1of 28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

JustanotherAllinOneTestKingSites

OracleQuestions&AnswersSearch
Searchfor:
Home
Membership
Subscribe

Go Search

CheckPoint
Cisco
CIW
CompTIA
CWNP
ECCouncil
ISC2
Juniper
Linux
Microsoft
Oracle
Sun
VMWare
EMC
Exin
Isilon
PMI
HP
IBM
ISACA
E XAM I NF ORM AT I ON

RSSfeedforthissection
Thiscategorycontains170posts
1Z0047OracleDatabaseSQLExpert.OracleDatabaseSQLExpertExamPreparationMaterialprovidesyoueverythingyouwillneedtotakeaOracle11g,
OracleCertification,SQLCertificationcertificationsexamination.DetailsareresearchedandproducedbyOracleCertificationExpertswhoareconstantlyusing
industryexperiencetoproduceprecise,andlogical.
WhichSQLstatementwouldyouexecutetoaccomplishthetask?
PostedbyadminonNovember11,2011

2comments

ViewtheExhibitandexaminethedescriptionsoftheDEPTandLOCATIONStables.

YouwanttoupdatetheCITYcolumnoftheDEPTtableforalltherowswiththecorrespondingvalueintheCITYcolumnoftheLOCATIONStableforeach
department.
WhichSQLstatementwouldyouexecutetoaccomplishthetask?
A.
UPDATEdeptd
SETcity=ANY(SELECTcity
FROMlocationsl)
B.
UPDATEdeptd
SETcity=(SELECTcity
FROMlocationsl)
WHEREd.location_id=l.location_id
C.
UPDATEdeptd
SETcity=(SELECTcity
FROMlocationsl
WHEREd.location_id=l.location_id)

D.
UPDATEdeptd
http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

1/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

SETcity=ALL(SELECTcity
FROMlocationsl
WHEREd.location_id=l.location_id)
ThedesiredoutputisnotobtainedafterexecutingtheaboveSQLstatement
PostedbyadminonNovember11,2011

1comment

ViewtheExhibitandexaminethedescriptionoftheDEPARTMENTSandEMPLOYEEStables.

ToretrievedataforalltheemployeesfortheirEMPLOYEE_ID,FIRST_NAME,andDEPARTMENTNAME,thefollowingSQLstatementwaswritten:
SELECTemployee_id,first_name,department_name
FROMemployees
NATURALJOINdepartments
ThedesiredoutputisnotobtainedafterexecutingtheaboveSQLstatement.
Whatcouldbethereasonforthis?
A.
TheNATURALJOINclauseismissingtheUSINGclause.
B.
ThetableprefixismissingforthecolumnnamesintheSELECTclause.
C.
TheDEPARTMENTStableisnotusedbeforetheEMPLOYEEStableintheFROMclause.
D.
TheEMPLOYEESandDEPARTMENTStableshavemorethanonecolumnwiththesamecolumnnameanddatatype.

Whichtwostatementsaretrueregardingtheoutput?
PostedbyadminonNovember11,2011

Nocomments

ViewtheExhibit1andexaminethedescriptionsoftheEMPLOYEESandDEPARTMENTStables.

SELECTe.department_id,e.job_id,d.location_id,sum(e.salary)totalGROUPING(e.department_id)GRP_DEPT,
GROUPING(e.job_id)GRP_JOB,
GROUPING(d.location_id)GRP_LOC
FROMemployeeseJOINdepartmentsd
ONe.department_id=d.department_id
GROUPBYROLLUP(e.department_id,e.job_id,d.location_id)
ViewtheExhibit2andexaminetheoutputofthecommand.

http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

2/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

Whichtwostatementsaretrueregardingtheoutput?(Choosetwo.)
A.
Thevalue1inGRP_LOCmeansthattheLOCATION_IDcolumnistakenintoaccounttogeneratethesubtotal.
B.
Thevalue1inGRP_JOBandGRP_LOCmeansthatJOB_IDandLOCATION_IDcolumnsarenottakenintoaccounttogeneratethesubtotal.

C.
Thevalue1inGRP_JOBandGRP_LOCmeansthattheNULLvalueinJOB_IDandLOCATION_IDcolumnsaretakenintoaccounttogeneratethesubtotal.
D.
Thevalue0inGRP_DEPT,GRP_JOB,andGRP_LOCmeansthatDEPARTMENT_ID,JOB_ID,andLOCATION_IDcolumnsaretakenintoaccounttogeneratethesubtotal.

WhichSQLstatementwouldyouexecute?
PostedbyadminonNovember11,2011

6comments

ViewtheExhibitandexaminethestructureoftheEMPLOYEEStable.

Youwanttodisplayallemployeesandtheirmanagershaving100astheMANAGER_ID.Youwanttheoutputintwocolumns:thefirstcolumnwouldhavethe
LAST_NAMEofthemanagersandthesecondcolumnwouldhaveLAST_NAMEoftheemployees.
WhichSQLstatementwouldyouexecute?
A.
SELECTm.last_nameManager,e.last_nameEmployeeFROMemployeesmJOINemployeese
ONm.employee_id=e.manager_id
WHEREm.manager_id=100
B.
SELECTm.last_nameManager,e.last_nameEmployeeFROMemployeesmJOINemployeese
ONm.employee_id=e.manager_id
WHEREe.manager_id=100

C.
SELECTm.last_nameManager,e.last_nameEmployeeFROMemployeesmJOINemployeese
ONe.employee_id=m.manager_id
WHEREm.manager_id=100
D.
SELECTm.last_nameManager,e.last_nameEmployeeFROMemployeesmJOINemployeese
WHEREm.employee_id=e.manager_idANDe.manager_id=100

Whichstatementistrueregardingthisquery?
http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

3/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

PostedbyadminonNovember11,2011

1comment

ViewtheExhibitandexaminethedescriptionoftheEMPLOYEEStable

EvaluatethefollowingSQLstatement:
SELECTfirst_name,employee_id,NEXT_DAY(ADD_MONTHS(hire_date,6),1)ReviewFROMemployees
ThequerywaswrittentoretrievetheFIRST_NAME,EMPLOYEE_ID,andreviewdateforemployees.ThereviewdateisthefirstMondayafterthecompletionof
sixmonthsofthehiring.TheNLS_TERRITORYparameterissettoAMERICAinthesession.
Whichstatementistrueregardingthisquery?
A.
Thequerywouldexecutetogivethedesiredoutput.
B.
Thequerywouldnotexecutebecausedatefunctionscannotbenested.
C.
ThequerywouldexecutebuttheoutputwouldgivereviewdatesthatareSundays.

D.
ThequerywouldnotexecutebecausetheNEXT_DAYfunctionacceptsastringasargument.
Whichisthecorrectsyntaxtocreateatablewiththefollowingcolumnspecifications?
PostedbyadminonNovember11,2011

1comment

Youneedtocreateatablewiththefollowingcolumnspecifications:
1.EmployeeID(numericdatatype)foreachemployee
2.EmployeeName,(characterdatatype)whichstorestheemployeename
3.Hiredate,tostorethedatewhentheemployeejoinedtheorganization
4.Status(characterdatatype).Itshouldcontainthevalueifnodataisentered.
5.Resume(characterlargeobject[CLOB]datatype),whichwouldcontaintheresumesubmittedbytheemployee
Whichisthecorrectsyntaxtocreatethistable?
A.
CREATETABLEEMP_1
(emp_idNUMBER(4),
emp_nameVARCHAR2(25),
start_dateDATE,
e_statusVARCHAR2(10)DEFAULTACTIVE,
resumeCLOB(200))
B.
CREATETABLE1_EMP
(emp_idNUMBER(4),
emp_nameVARCHAR2(25),
start_dateDATE,
emp_statusVARCHAR2(10)DEFAULTACTIVE,
resumeCLOB)
C.
CREATETABLE1_EMP
(emp_idNUMBER(4),
emp_nameVARCHAR2(25),
start_dateDATE,
emp_statusVARCHAR2(10)DEFAULTACTIVE,
resumeCLOB)
D.
CREATETABLEEMP_1
(emp_idNUMBER,
emp_nameVARCHAR2(25),
start_dateDATE,
emp_statusVARCHAR2(10)DEFAULTACTIVE,
resumeCLOB)

http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

4/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

Whichquerywouldgiveyouthedesiredoutput?
PostedbyadminonNovember11,2011

Nocomments

ViewtheExhibitandexaminethestructureoftheORDERStable.

YouhavetodisplayORDER_ID,ORDER_DATE,andCUSTOMER_IDforallthoseordersthatwereplacedafterthelastorderplacedbythecustomerwhose
CUSTOMER_IDis101.
Whichquerywouldgiveyouthedesiredoutput?
A.
SELECTorder_id,order_dateFROMorders
WHEREorder_date>ALL(SELECTMAX(order_date)
FROMorders)AND
customer_id=101
B.
SELECTorder_id,order_dateFROMorders
WHEREorder_date>ANY(SELECTorder_date
FROMorders
WHEREcustomer_id=101)
C.
SELECTorder_id,order_dateFROMorders
WHEREorder_date>ALL(SELECTorder_date
FROMorders
WHEREcustomer_id=101)

D.
SELECTorder_id,order_dateFROMorders
WHEREorder_dateIN(SELECTorder_date
FROMorders
WHEREcustomer_id=101)
WhichstatementwouldaddaNOTNULLconstrainttotheCUSTOMER_IDcolumn?
PostedbyadminonNovember11,2011

Nocomments

ViewtheExhibitandexaminetheORDERStable.

TheORDERStablecontainsdataandall
ordershavebeenassignedacustomerID.
WhichstatementwouldaddaNOTNULLconstrainttotheCUSTOMER_IDcolumn?
A.
ALTERTABLEorders
ADDCONSTRAINTorders_cust_id_nnNOTNULL(customer_id)
B.
ALTERTABLEorders
MODIFYcustomer_idCONSTRAINTorders_cust_id_nnNOTNULL

http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

5/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

C.
ALTERTABLEorders
MODIFYCONSTRAINTorders_cust_id_nnNOTNULL(customer_id)
D.
ALTERTABLEorders
ADDcustomer_idNUMBER(6)CONSTRAINTorders_cust_id_nnNOTNULL
WhatwouldbetheoutcomeofthefollowingMERGEstatement?
PostedbyadminonNovember11,2011

3comments

ViewtheExhibitandexaminethedatainORDERS_MASTERandMONTHLY_ORDERStables.

EvaluatethefollowingMERGEstatement:
MERGEINTOorders_mastero
USINGmonthly_ordersm
ON(o.order_id=m.order_id)
WHENMATCHEDTHEN
UPDATESETo.order_total=m.order_total
DELETEWHERE(m.order_totalISNULL)
WHENNOTMATCHEDTHEN
INSERTVALUES(m.order_id,m.order_total)
Whatwouldbetheoutcomeoftheabovestatement?
A.
TheORDERS_MASTERtablewouldcontaintheORDER_IDs1and2.
B.
TheORDERS_MASTERtablewouldcontaintheORDER_IDs1,2and3.
C.
TheORDERS_MASTERtablewouldcontaintheORDER_IDs1,2and4.

D.
TheORDERS_MASTERtablewouldcontaintheORDER_IDs1,2,3and4.
WhichSQLclauseswouldyourequiretoaccomplishthetask?
PostedbyadminonNovember11,2011

Nocomments

ViewtheExhibitandexaminethedetailsoftheEMPLOYEEStable.

YouwanttogenerateahierarchicalreportforalltheemployeeswhoreporttotheemployeewhoseEMPLOYEE_IDis100.
http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

6/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

WhichSQLclauseswouldyourequiretoaccomplishthetask?(Chooseallthatapply.)
A.
WHERE

B.
HAVING
C.
GROUPBY
D.
STARTWITH

E.
CONNECTBY

WhichthreestatementsaretrueregardingtheoutputofthisSQLstatement?
PostedbyadminonNovember11,2011

4comments

ViewtheExhibitandexaminethedescriptionsforORDERSandORDER_ITEMStables.

EvaluatethefollowingSQLstatement:
SELECTo.customer_id,oi.product_id,SUM(oi.unit_price*oi.quantity)OrderAmountFROMorder_itemsoiJOINorderso
ONoi.order_id=o.order_id
GROUPBYCUBE(o.customer_id,oi.product_id)
WhichthreestatementsaretrueregardingtheoutputofthisSQLstatement?(Choosethree.)
A.
ItwouldreturnthesubtotalsfortheOrderAmountofeveryCUSTOMER_ID.B.ItwouldreturnthesubtotalsfortheOrderAmountforeveryPRODUCT_ID.

B.
ItwouldreturnthesubtotalsfortheOrderAmountofeveryPRODUCT_IDandCUSTOMER_IDasonegroup.

C.
ItwouldreturnthesubtotalsfortheOrderAmountofeveryCUSTOMER_IDandPRODUCT_IDasonegroup.
D.
ItwouldreturnonlythegrandtotalfortheOrderAmountofeveryCUSTOMER_IDandPRODUCT_IDasonegroup.

WhichUPDATEstatementisvalid?
PostedbyadminonNovember11,2011

3comments

ViewtheExhibitandexaminethestructureoftheORDERStable.

WhichUPDATEstatementisvalid?
http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

7/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

A.
UPDATEorders
SETorder_date=12mar2007,
order_totalISNULL
WHEREorder_id=2455
B.
UPDATEorders
SETorder_date=12mar2007,
order_total=NULL
WHEREorder_id=2455

C.
UPDATEorders
SETorder_date=12mar2007
ANDorder_total=TO_NUMBER(NULL)
WHEREorder_id=2455
D.
UPDATEorders
SETorder_date=TO_DATE(12mar2007,ddmonyyyy),SETorder_total=TO_NUMBER(NULL)
WHEREorder_id=2455
WhichSQLstatementwouldgiveyouthedesiredresult?
PostedbyadminonNovember11,2011

2comments

ViewtheExhibitandexaminethestructureoftheEMPLOYEEStable

YouwanttoknowtheFIRST_NAMEandSALARYforallemployeeswhohavethesamemanagerasthatoftheemployeewiththefirstnameNeenaandhave
salaryequaltoorgreaterthanthatofNeena.
WhichSQLstatementwouldgiveyouthedesiredresult?
A.
SELECTfirst_name,salary
FROMemployees
WHERE(manager_id,salary)>=ALL(SELECTmanager_id,salaryFROMemployees
WHEREfirst_name=Neena)
ANDfirst_name<>Neena'
B.
SELECTfirst_name,salary
FROMemployees
WHERE(manager_id,salary)>=(SELECTmanager_id,salaryFROMemployees
WHEREfirst_name=Neena)
ANDfirst_name<>Neena'
C.
SELECTfirst_name,salary
FROMemployees
WHERE(manager_id,salary)>=ANY(SELECTmanager_id,salaryFROMemployees
WHEREfirst_name=Neena)
ANDfirst_name<>Neena'
D.
SELECTfirst_name,salary
FROMemployees
WHERE(manager_id=(SELECTmanager_id
FROMemployees
WHEREfirst_name=Neena)
ANDsalary>=(SELECTsalary
FROMemployees
WHEREfirst_name=Neena))
ANDfirst_name<>Neena'

Whichstatementistrueregardingtheexecutionofthestatement?
PostedbyadminonNovember11,2011
http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

1comment
8/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

ViewtheExhibitandexaminethestructureoftheORDER_ITEMSandORDERStables.

YouareaskedtoretrievetheORDER_ID,PRODUCT_ID,andtotalprice(UNIT_PRICEmultipliedbyQUANTITY),wherethetotalpriceisgreaterthan50,000.
YouexecutedthefollowingSQLstatement:
SELECTorder_id,product_id,unit_price*quantityTotalPriceFROMorder_items
WHEREunit_price*quantity>50000
NATURALJOINorders
Whichstatementistrueregardingtheexecutionofthestatement?
A.
Thestatementwouldexecuteandprovidethedesiredresult.
B.
ThestatementwouldnotexecutebecausetheONkeywordismissingintheNATURALJOINclause.
C.
ThestatementwouldnotexecutebecausetheWHEREclauseisbeforetheNATURALJOINclause.

D.
ThestatementwouldnotexecutebecausetheUSINGkeywordismissingintheNATURALJOINclause.

WhywouldtheINSERTstatementfail?
PostedbyadminonNovember11,2011

Nocomments

ViewtheExhibitandexaminethestructureoftheORDERStable.

NEW_ORDERSisanewtablewiththecolumnsORD_ID,ORD_DATE,CUST_ID,andORD_TOTALthathavethesamedatatypesandsizeasthecorresponding
columnsintheORDERStable.EvaluatethefollowingINSERTstatement:
INSERTINTOnew_orders(ord_id,ord_date,cust_id,ord_total)VALUES(SELECTorder_id,order_date,customer_id,order_totalFROMorders
WHEREorder_date>31dec1999)
WhywouldtheINSERTstatementfail?
A.
http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

9/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

becausecolumnnamesinNEW_ORDERSandORDERStablesdonotmatch
B.
becausetheVALUESclausecannotbeusedinanINSERTwithasubquery

C.
becausetheWHEREclausecannotbeusedinasubqueryembeddedinanINSERTstatement
D.
becausethetotalnumberofcolumnsintheNEW_ORDERStabledoesnotmatchthetotalnumberofcolumnsintheORDERStable
WhichSQLstatementwouldyouexecutetodisplaytheexpirationdateofthewarrantyforaproduct?
PostedbyadminonNovember11,2011

2comments

ViewtheExhibitandexaminethedescriptionofthePRODUCT_INFORMATIONtable.

Youwanttodisplaytheexpirationdateofthewarrantyforaproduct.
WhichSQLstatementwouldyouexecute?
A.
SELECTproduct_id,SYSDATE+warranty_period
FROMproduct_information

B.
SELECTproduct_id,TO_YMINTERVAL(warranty_period)
FROMproduct_information
C.
SELECTproduct_id,TO_YMINTERVAL(SYSDATE)+warranty_periodFROMproduct_information
D.
SELECTproduct_id,TO_YMINTERVAL(SYSDATE+warranty_period)FROMproduct_information
Identifytheoptionthatcorrectlymatchesthedatatypeswiththevalues.
PostedbyadminonNovember11,2011

Nocomments

Givenbelowisalistofdatetimedatatypesandexamplesofvaluesstoredintheminarandomorder:
DatatypeExample
1)INTERVALYEARTOMONTHa)200304158:00:008:00
2)TIMESTAMPWITHLOCALTIMEZONEb)+0603:30:16.000000
3)TIMESTAMPWITHTIMEZONEc)17JUN0312.00.00.000000AM
4)INTERVALDAYTOSECONDd)+0200
Identifytheoptionthatcorrectlymatchesthedatatypeswiththevalues.
A.
1d,2c,3a,4b

B.
1b,2a,3c,4d
C.
1b,2a,3d,4c
D.
1d,2c,3b,4a
Whichstatementistrueregardingtheoutputforthiscommand?
PostedbyadminonNovember11,2011

Nocomments

ViewtheExhibitandexaminethestructureoftheEMPLOYEEStable
http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

10/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

EvaluatethefollowingSQLstatement:
SELECTemployee_id,last_name,job_id,manager_id
FROMemployees
STARTWITHemployee_id=101
CONNECTBYPRIORemployee_id=manager_id
Whichstatementistrueregardingtheoutputforthiscommand?
A.
ItwouldreturnahierarchicaloutputstartingwiththeemployeewhoseEMPLOYEE_IDis101,followedbyhisorherpeers.
B.
ItwouldreturnahierarchicaloutputstartingwiththeemployeewhoseEMPLOYEE_IDis101,followedbytheemployeetowhomheorshereports.
C.
ItwouldreturnahierarchicaloutputstartingwiththeemployeewhoseEMPLOYEE_IDis101,followedbyemployeesbelowhimorherinthehierarchy.

D.
ItwouldreturnahierarchicaloutputstartingwiththeemployeewhoseEMPLOYEE_IDis101,followedbyemployeesuptoonelevelbelowhimorherinthe
hierarchy.
WhichtwoINSERTstatementsarevalid?
PostedbyadminonNovember11,2011

Nocomments

ViewtheExhibitandexaminethestructureoftheORDERStable.

ThecolumnsORDER_MODEandORDER_TOTALhavethedefaultvaluesdirectand0respectively.
WhichtwoINSERTstatementsarevalid?(Choosetwo.)
A.
INSERTINTOorders
VALUES(1,09mar2007,online,,1000)
B.
INSERTINTOorders
(order_id,order_date,order_mode,
customer_id,order_total)
VALUES(1,TO_DATE(NULL),online,101,NULL)
C.
INSERTINTO
(SELECTorder_id,order_date,customer_id
FROMorders)
VALUES(1,09mar2007,101)

D.
INSERTINTOorders
VALUES(1,09mar2007,DEFAULT,101,DEFAULT)

E.
INSERTINTOorders
(order_id,order_date,order_mode,order_total)
VALUES(1,10mar2007,online,1000)
http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

11/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

Whichtwostatementsaretrueabouttheoutput?
PostedbyadminonNovember11,2011

4comments

EvaluatethefollowingSELECTstatementandviewtheExhibittoexamineitsoutput:
SELECTconstraint_name,constraint_type,search_condition,r_constraint_name,delete_rule,statusFROMuser_constraints
WHEREtable_name=ORDERS
Whichtwostatementsaretrueabouttheoutput?(Choosetwo.)

A.
Inthesecondcolumn,indicatesacheckconstraint.

B.
TheSTATUScolumnindicateswhetherthetableiscurrentlyinuse.
C.
TheR_CONSTRAINT_NAMEcolumngivesthealternativenamefortheconstraint.
D.
ThecolumnDELETE_RULEdecidesthestateoftherelatedrowsinthechildtablewhenthecorrespondingrowisdeletedfromtheparenttable.

WhichSEToperatorshouldbeusedintheblankspaceinthefollowingSQLstatementtodisplaythecities
PostedbyadminonNovember11,2011

Nocomments

ViewtheExhibitandexaminethestructureoftheLOCATIONSandDEPARTMENTStables.

WhichSEToperatorshouldbeusedintheblankspaceinthefollowingSQLstatementtodisplaythecitiesthathavedepartmentslocatedinthem?
SELECTlocation_id,city
FROMlocations
____
SELECTlocation_id,city
FROMlocationsJOINdepartments
USING(location_id)
A.
UNION
B.
MINUS
C.
INTERSECT

D.
UNIONALL
WhatwouldbethestatusoftheforeignkeyEMP_MGR_FK?
PostedbyadminonNovember11,2011

Nocomments

EvaluatethefollowingSQLstatementsthatareissuedinthegivenorder:

http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

12/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

WhatwouldbethestatusoftheforeignkeyEMP_MGR_FK?
A.
Itwouldbeautomaticallyenabledanddeferred.
B.
Itwouldbeautomaticallyenabledandimmediate.
C.
ItwouldremaindisabledandhastobeenabledmanuallyusingtheALTERTABLEcommand.

D.
Itwouldremaindisabledandcanbeenabledonlybydroppingtheforeignkeyconstraintandrecreatingit.
Whichstatementistrueregardingtheexecutionandoutputofthecommand?
PostedbyadminonNovember11,2011

2comments

ViewtheExhibitandexamineDEPARTMENTSandtheLOCATIONStables.

EvaluatethefollowingSQLstatement:
SELECTlocation_id,city
FROMlocations
lWHERENOTEXISTS(SELECTlocation_id
FROMdepartments
WHERElocation_id<>l.location_id)
ThisstatementwaswrittentodisplayLOCATION_IDandCITYwheretherearenodepartmentslocated.
Whichstatementistrueregardingtheexecutionandoutputofthecommand?
A.
Thestatementwouldexecuteandwouldreturnthedesiredresults.
B.
Thestatementwouldnotexecutebecausethe=comparisonoperatorismissingintheWHEREclauseoftheouterquery.
C.
ThestatementwouldexecutebutitwillreturnzerorowsbecausetheWHEREclauseintheinnerqueryshouldhavethe=operatorinsteadof<>.

D.
ThestatementwouldnotexecutebecausetheWHEREclauseintheouterqueryismissingthecolumnnameforcomparisonwiththeinnerqueryresult.
WhichstatementistrueregardingtheoutputofthisSQLstatement?
PostedbyadminonNovember11,2011

Nocomments

ViewtheExhibitandexaminethedescriptionoftheORDER_ITEMSandPRODUCT_INFORMATIONtables.

http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

13/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

TheORDER_ITEMtablehasrecordspertainingtodetailsforeachproductinanorder.ThePRODUCT_INFORMATIONtablehasrecordsforalltheproducts
availableforordering.EvaluatethefollowingSQLstatement:
SELECToi.order_id,pi.product_id
FROMorder_itemsoiRIGHTOUTERJOINproduct_informationpiON(oi.product_id=pi.product_id)
WhichstatementistrueregardingtheoutputofthisSQLstatement?
A.
ThequerywouldreturntheORDER_IDandPRODUCT_IDforonlythoseproductsthatareordered.
B.
ThequerywouldreturntheORDER_IDandPRODUCT_IDfortheproductsthatareorderedaswellasfortheproductsthathaveneverbeenordered.

C.
ThequerywouldreturntheORDER_IDandPRODUCT_IDfortheproductsthatareorderedbutnotlistedinthePRODUCT_INFORMATIONtable.
D.
ThequerywouldreturntheORDER_IDandPRODUCT_IDforthoseproductsthatareorderedaswellasfortheproductsthathaveneverbeenordered,andforthe
productsthatarenotlistedinthePRODUCT_INFORMATIONtable.
WhichSEToperatorwouldyouuseintheblankspaceinthefollowingSQLstatementtolistthedepartments
PostedbyadminonNovember11,2011

Nocomments

ViewtheExhibitandexaminethestructureoftheEMPLOYEESandDEPARTMENTStables.

WhichSEToperatorwouldyouuseintheblankspaceinthefollowingSQLstatementtolistthedepartmentswherealltheemployeeshavemanagers?
SELECTdepartment_id
FROMdepartments
____
SELECTdepartment_id
FROMemployees
WHEREmanager_idISNULL
A.
UNION
B.
MINUS

C.
INTERSECT
D.
UNIONALL
Whichquerywouldproducethedesiredoutput?
PostedbyadminonNovember11,2011
http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

1comment
14/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

ViewtheExhibitandexaminethestructureoftheORDER_ITEMStable.

YouneedtodisplaytheORDER_IDoftheorderthathasthehighesttotalvalueamongalltheordersintheORDER_ITEMStable.
Whichquerywouldproducethedesiredoutput?
A.
SELECTorder_id
FROMorder_items
WHERE(unit_price*quantity)=MAX(unit_price*quantity)GROUPBYorder_id
B.
SELECTorder_id
FROMorder_items
WHERE(unit_price*quantity)=(SELECTMAX(unit_price*quantity)FROMorder_items)
GROUPBYorder_id
C.
SELECTorder_id
FROMorder_items
WHERE(unit_price*quantity)=(SELECTMAX(unit_price*quantity)FROMorder_items
GROUPBYorder_id)
D.
SELECTorder_id
FROMorder_items
GROUPBYorder_id
HAVINGSUM(unit_price*quantity)=(SELECTMAX(SUM(unit_price*quantity))FROMorder_itemsGROUPBYorder_id)

Whichstatementistrueregardingthecommands?
PostedbyadminonNovember11,2011

3comments

ViewtheExhibitandexaminethestructureoftheORDERStable.

TheORDERStablebelongstotheuserOE.HRisanotheruserinthedatabase.EvaluatethecommandsissuedbyusersOEandHRinthefollowingorder:
Statement1byuserOE:GRANTSELECT,
UPDATE(customer_id,order_total)
ONorders
TOhr
Statement1byuserHR:SELECT*FROMoe.orders
Statement2byuserHR:UPDATEoe.orders
SETorder_total=10000
Whichstatementistrueregardingtheabovecommands?
A.
Statement1byuserOEwouldnotworkbecausethestatementhastobeissuedbytheDBA.
B.
http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

15/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

Statement2byuserHRwouldnotworkbecausethegrantisonlyforSELECTinasubqueryofupdate.
C.
TherearenoerrorsinthestatementsissuedbyOEandHRallthestatementswouldexecutesuccessfully.

D.
Statement1byuserHRwouldnotworkbecauseSELECTandUPDATEprivilegeshavebeengrantedonlyonCUSTOMER_IDandORDER_TOTALcolumns.
WhichSQLstatementwouldgetyouthedesiredresult?
PostedbyadminonNovember11,2011

Nocomments

ViewtheExhibitandexaminethedescriptionoftheEMPLOYEEStable.

YouwanttoknowtheEMPLOYEE_IDandFIRST_NAMEofalltherecordsintheEMPLOYEEStablewhereintheJOB_IDcolumnhasST_CLERKorST_MAN
values,theDEPARTMENT_IDcolumnhasvalue30,andtheSALARYcolumnhasavaluegreaterthan3,000.
WhichSQLstatementwouldgetyouthedesiredresult?
A.
SELECTemployee_id,first_name
FROMemployees
WHEREjob_idlikeMAN%ORjob_idlikeCLERK%
ANDdepartment_id=30ANDsalary>3000
B.
SELECTemployee_id,first_name
FROMemployees
WHEREjob_idlike%MANORjob_idlike%CLERK
AND(department_id=30ORsalary>3000)
C.
SELECTemployee_id,first_name
FROMemployees
WHERE(job_idlike%MANANDjob_idlike%CLERK)ANDdepartment_id=30ORsalary>3000
D.
SELECTemployee_id,first_name
FROMemployees
WHERE(job_idlike%MANORjob_idlike%CLERK)ANDdepartment_id=30ANDsalary>3000

WhichtwoORDERBYclausescanbeusedtosorttheoutputoftheabovestatement?
PostedbyadminonNovember11,2011

1comment

ViewtheExhibitandexaminethedataintheDEPARTMENTStables.

EvaluatethefollowingSQLstatement:

http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

16/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

WhichtwoORDERBYclausescanbeusedtosorttheoutputoftheabovestatement?(Choosetwo.)
A.
ORDERBY3

B.
ORDERBYb'
C.
ORDERBYDEPT_ID

D.
ORDERBYDEPT_NAME
Whichstatementistrueregardingtheexecutionandtheoutputofthisstatement?
PostedbyadminonNovember11,2011

2comments

ViewtheExhibitandexaminethedescriptionofEMPLOYEESandDEPARTMENTStables.

YouwanttodisplaytheEMPLOYEE_ID,LAST_NAME,andSALARYfortheemployeeswhogetthemaximumsalaryintheirrespectivedepartments.The
followingSQLstatementwaswritten:
WITH
SELECTemployee_id,last_name,salary
FROMemployees
WHERE(department_id,salary)=ANY(SELECT*
FROMdept_max)
dept_maxas(SELECTd.department_id,max(salary)
FROMdepartmentsdJOINemployeesj
ON(d.department_id=j.department_id)
GROUPBYd.department_id)
Whichstatementistrueregardingtheexecutionandtheoutputofthisstatement?
A.
Thestatementwouldexecuteandgivethedesiredresults.
B.
Thestatementwouldnotexecutebecausethe=ANYcomparisonoperatorisusedinsteadof=.
C.
Thestatementwouldnotexecutebecausethemainqueryblockusesthequerynamebeforeitisevencreated.

D.
Thestatementwouldnotexecutebecausethecommaismissingbetweenthemainqueryblockandthequeryname.
WhichstatementistrueregardingthefollowingCREATETABLEcommand?
PostedbyadminonNovember11,2011

2comments

EvaluatethefollowingCREATETABLEcommand:
CREATETABLEorder_item
(order_idNUMBER(3),
item_idNUMBER(2),
qtyNUMBER(4),
CONSTRAINTord_itm_id_pk
PRIMARYKEY(order_id,item_id)
http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

17/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

USINGINDEX
(CREATEINDEXord_itm_idx
ONorder_item(order_id,item_id)))
WhichstatementistrueregardingtheaboveSQLstatement?
A.
ItwouldexecutesuccessfullyandonlyORD_ITM_IDXindexwouldbecreated.

B.
ItwouldgiveanerrorbecausetheUSINGINDEXclausecannotbeusedonacompositeprimarykey.
C.
ItwouldexecutesuccessfullyandtwoindexesORD_ITM_IDXandORD_ITM_ID_PKwouldbecreated.
D.
ItwouldgiveanerrorbecausetheUSINGINDEXclauseisnotpermittedintheCREATETABLEcommand.
Whichstatementdescribestheconsequences?
PostedbyadminonNovember11,2011

Nocomments

GivenbelowaretheSQLstatementsexecutedinausersession:
CREATETABLEproduct
(pcodeNUMBER(2),
pnameVARCHAR2(10))
INSERTINTOproductVALUES(1,pen)
INSERTINTOproductVALUES(2,pencil)
SAVEPOINTa
UPDATEproductSETpcode=10WHEREpcode=1
SAVEPOINTb
DELETEFROMproductWHEREpcode=2
COMMIT
DELETEFROMproductWHEREpcode=10
ROLLBACKTOSAVEPOINTa
Whichstatementdescribestheconsequences?
A.
NoSQLstatementwouldberolledback.

B.
BoththeDELETEstatementswouldberolledback.
C.
OnlythesecondDELETEstatementwouldberolledback.
D.
BoththeDELETEstatementsandtheUPDATEstatementwouldberolledback.
WhatistheerrorinthefollowingMERGEstatement?
PostedbyadminonNovember11,2011

2comments

ViewtheExhibitandexaminethestructureoftheCUSTOMERStable.

CUSTOMER_VUisaviewbasedonCUSTOMERS_BR1tablewhichhasthesamestructureasCUSTOMERStable.CUSTOMERSneedstobeupdatedtoreflect
thelatestinformationaboutthecustomers.
WhatistheerrorinthefollowingMERGEstatement?
MERGEINTOcustomersc
USINGcustomer_vucv
ON(c.customer_id=cv.customer_id)
WHENMATCHEDTHEN
UPDATESET
customer_id=cv.customer_id,
cust_name=cv.cust_name,
cust_email=cv.cust_email,
income_level=cv.income_levelWHENNOTMATCHEDTHENINSERTVALUES(cv.customer_id,cv.cust_name,cv.cust_email,cv,income_level)WHERE
cv.income_level>100000
http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

18/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

A.
TheCUSTOMER_IDcolumncannotbeupdated.

B.
TheINTOclauseismisplacedinthecommand.
C.
TheWHEREclausecannotbeusedwithINSERT.
D.
CUSTOMER_VUcannotbeusedasadatasource.
WhichtwoCREATEINDEXstatementarevalid?
PostedbyadminonNovember11,2011

2comments

ViewtheExhibitandexaminethestructureofORDandORD_ITEMStables.

IntheORDtable,thePRIMARYKEYisORD_NOandintheORD_ITEMStablesthecompositePRIMARYKEYis(ORD_NO,ITEM_NO).
WhichtwoCREATEINDEXstatementsarevalid?(Choosetwo.)
A.
CREATEINDEXord_idx
ONord(ord_no)
B.
CREATEINDEXord_idx
ONord_items(ord_no)

C.
CREATEINDEXord_idx
ONord_items(item_no)

D.
CREATEINDEXord_idx
ONord,ord_items(ord_no,ord_date,qty)
Whichstatementistrueregardingtheeffectofthecommand?
PostedbyadminonNovember11,2011

Nocomments

ViewtheExhibitandexaminethestructureoftheEMPtable.

YouexecutedthefollowingcommandtoaddaprimarykeytotheEMPtable:
ALTERTABLEemp
ADDCONSTRAINTemp_id_pkPRIMARYKEY(emp_id)
USINGINDEXemp_id_idx
Whichstatementistrueregardingtheeffectofthecommand?
A.
ThePRIMARYKEYiscreatedalongwithanewindex.
B.
ThePRIMARYKEYiscreatedanditwoulduseanexistinguniqueindex.

http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

19/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

C.
ThePRIMARYKEYwouldbecreatedinadisabledstatebecauseitisusinganexistingindex.
D.
ThestatementproducesanerrorbecausetheUSINGclauseispermittedonlyinthe
CREATETABLEcommand.
WhichSQLstatementwouldretrievefromthetablethenumberofproductshavingLIST_PRICEasNULL?
PostedbyadminonNovember11,2011

1comment

ViewtheExhibitandexaminethedescriptionofthePRODUCT_INFORMATIONtable.

WhichSQLstatementwouldretrievefromthetablethenumberofproductshavingLIST_PRICEasNULL?
A.
SELECTCOUNT(list_price)
FROMproduct_information
WHERElist_priceISNULL
B.
SELECTCOUNT(list_price)
FROMproduct_information
WHERElist_price=NULL
C.
SELECTCOUNT(NVL(list_price,0))
FROMproduct_information
WHERElist_priceISNULL

D.
SELECTCOUNT(DISTINCTlist_price)
FROMproduct_information
WHERElist_priceISNULL
WhichstatementistrueregardingtheexecutionofthefollowingSQLstatement?
PostedbyadminonNovember11,2011

1comment

ViewtheExhibitandexaminethedescriptionoftheORDERStable.

EvaluatethefollowingSQLstatement:
http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

20/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

SELECTorder_id,customer_id
FROMorders
WHEREorder_date>June302001
WhichstatementistrueregardingtheexecutionofthisSQLstatement?
A.
ItwouldnotexecutebecauseJune302001intheWHEREconditionisnotenclosedwithindoublequotationmarks.
B.
ItwouldexecuteandwouldreturnORDER_IDandCUSTOMER_IDforallrecordshavingORDER_DATEgreaterthanJune302001.
C.
ItwouldnotexecutebecauseJune302001intheWHEREconditioncannotbeconvertedimplicitlyandneedstheuseoftheTO_DATEconversionfunctionforproperexecution.

D.
ItwouldnotexecutebecauseJune302001intheWHEREconditioncannotbeconvertedimplicitlyandneedstheuseoftheTO_CHARconversionfunctionfor
properexecution.
Whatwouldbetheoutcomeofthefollowingstatements?
PostedbyadminonNovember11,2011

1comment

Evaluatethefollowingstatements:
CREATETABLEdigits
(idNUMBER(2),
descriptionVARCHAR2(15))
INSERTINTOdigitsVALUES(1,ONE)
UPDATEdigitsSETdescription=TWOWHEREid=1
INSERTINTOdigitsVALUES(2,TWO)
COMMIT
DELETEFROMdigits
SELECTdescriptionFROMdigits
VERSIONSBETWEENTIMESTAMPMINVALUEANDMAXVALUE
Whatwouldbetheoutcomeoftheabovequery?
A.
Itwouldnotdisplayanyvalues.
B.
ItwoulddisplaythevalueTWOonce.
C.
ItwoulddisplaythevalueTWOtwice.

D.
ItwoulddisplaythevaluesONE,TWO,andTWO.
WhichstatementistrueregardingtheaboveFLASHBACKoperation?
PostedbyadminonNovember11,2011

Nocomments

EvaluatethefollowingSQLstatementsinthegivenorder:
DROPTABLEdept
CREATETABLEdept
(deptnoNUMBER(3)PRIMARYKEY,
deptnameVARCHAR2(10))
DROPTABLEdept
FLASHBACKTABLEdeptTOBEFOREDROP
WhichstatementistrueregardingtheaboveFLASHBACKoperation?
A.
ItrecoversonlythefirstDEPTtable.
B.
ItrecoversonlythesecondDEPTtable.

C.
ItdoesnotrecoveranyofthetablesbecauseFLASHBACKisnotpossibleinthiscase.
D.
ItrecoversboththetablesbutthenameswouldbechangedtotheonesassignedintheRECYCLEBIN.
WhichstatementistrueregardingtheexecutionofthisSQLstatement?
PostedbyadminonNovember11,2011

2comments

ViewtheExhibitandexaminethestructureoftheORDERSandORDER_ITEMStables.
http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

21/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

EvaluatethefollowingSQLstatement:
SELECToi.order_id,product_id,order_date
FROMorder_itemsoiJOINorderso
USING(order_id)
WhichstatementistrueregardingtheexecutionofthisSQLstatement?
A.
ThestatementwouldnotexecutebecausetablealiasesarenotallowedintheJOINclause.
B.
ThestatementwouldnotexecutebecausethetablealiasprefixisnotusedintheUSINGclause.
C.
ThestatementwouldnotexecutebecauseallthecolumnsintheSELECTclausearenotprefixedwithtablealiases.
D.
ThestatementwouldnotexecutebecausethecolumnpartoftheUSINGclausecannothaveaqualifierintheSELECTlist.

WhichstatementsaretrueregardingtheoutputoftheseSQLstatements?
PostedbyadminonNovember11,2011

1comment

ViewtheExhibitandexaminethedetailsoftheORDER_ITEMStable.

EvaluatethefollowingSQLstatements:
Statement1:
SELECTMAX(unit_price*quantity)MaximumOrder
FROMorder_items
Statement2:
SELECTMAX(unit_price*quantity)MaximumOrder
FROMorder_items
GROUPBYorder_id
WhichstatementsaretrueregardingtheoutputoftheseSQLstatements?(Chooseallthatapply.)
A.
Statement1wouldreturnonlyonerowofoutput.

B.
Boththestatementswouldgivethesameoutput.
C.
Statement2wouldreturnmultiplerowsofoutput.

D.
http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

22/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

Statement1wouldnotreturnanyrowbecausetheGROUPBYclauseismissing.
E.
BothstatementswouldignoreNULLvaluesfortheUNIT_PRICEandQUANTITYcolumns.

WhichSQLstatementwouldyouexecutetofulfillthisrequirement?
PostedbyadminonNovember11,2011

2comments

ViewtheExhibitandexaminethestructureofthePRODUCT_INFORMATIONtable.

Youwanttoseetheproductnamesandthedateofexpirationofwarrantyforalltheproducts,iftheproductispurchasedtoday.Theproductsthathavenowarranty
shouldbedisplayedatthetopandtheproductswithmaximumwarrantyperiodshouldbedisplayedatthebottom.
WhichSQLstatementwouldyouexecutetofulfillthisrequirement?
A.
SELECTproduct_name,category_id,SYSDATE+warranty_periodASWarrantyexpiredateFROMproduct_informationORDERBYSYSDATE
warranty_period
B.
SELECTproduct_name,category_id,SYSDATE+warranty_periodASWarrantyexpiredateFROMproduct_informationORDERBYSYSDATE+warranty_period

C.
SELECTproduct_name,category_id,SYSDATE+warranty_periodASWarrantyexpiredateFROMproduct_informationORDERBYSYSDATE
D.
SELECTproduct_name,category_id,SYSDATE+warranty_periodWarrantyexpiredateFROMproduct_informationWHEREwarranty_period>SYSDATE
Yourcompanywantstogive5%bonustoalltheemployeesontheirannualsalary
PostedbyadminonNovember11,2011

1comment

ViewtheExhibitandexaminethedescriptionoftheEMPLOYEEStable.

Yourcompanywantstogive5%bonustoalltheemployeesontheirannualsalary.TheSALARYcolumnstoresthemonthlysalaryforanemployee.Tocheckthe
totalforannualsalaryandbonusamountforeachemployee,youissuedthefollowingSQLstatement:
SELECTfirst_name,salary,salary*12+salary*12*.05ANNUALSALARY+BONUSFROMemployees
Whichstatementistrueregardingtheabovequery?
A.
Itwouldexecuteandgiveyouthedesiredoutput.

B.
ItwouldnotexecutebecausetheASkeywordismissingbetweenthecolumnnameandthealias.
http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

23/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

C.
Itwouldnotexecutebecausedoublequotationmarksareusedinsteadofsinglequotationmarksforassigningaliasforthethirdcolumn.
D.
Itwouldexecutebuttheresultforthethirdcolumnwouldbeinaccuratebecausetheparenthesesforoverridingtheprecedenceoftheoperatoraremissing.
WhatwouldbetheoutcomeoftheaboveINSERTstatement?
PostedbyadminonNovember11,2011

4comments

ViewtheExhibitandexaminethestructureoftheORDERStable:

TheORDER_IDcolumnhasthePRIMARYKEYconstraintandCUSTOMER_IDhastheNOTNULLconstraint.
Evaluatethefollowingstatement:
INSERTINTO(SELECTorder_id,order_date,customer_idFROMORDERS
WHEREorder_total=1000
WITHCHECKOPTION)VALUES(13,SYSDATE,101)
WhatwouldbetheoutcomeoftheaboveINSERTstatement?
A.
Itwouldexecutesuccessfullyandthenewrowwouldbeinsertedintoanewtemporarytablecreatedbythesubquery.
B.
ItwouldexecutesuccessfullyandtheORDER_TOTALcolumnwouldhavethevalue1000insertedautomaticallyinthenewrow.
C.
ItwouldnotexecutesuccessfullybecausetheORDER_TOTALcolumnisnotspecifiedintheSELECTlistandnovalueisprovidedforit.

D.
ItwouldnotexecutesuccessfullybecauseallthecolumnsfromtheORDERStableshouldhavebeenincludedintheSELECTlistandvaluesshouldhavebeen
providedforallthecolumns.
WhichrowswouldbemadepermanentintheCUSTtable?
PostedbyadminonNovember11,2011

2comments

ViewtheExhibitandexaminethestructureoftheCUSTtable.

EvaluatethefollowingSQLstatementsexecutedinthegivenorder:
ALTERTABLEcust
ADDCONSTRAINTcust_id_pkPRIMARYKEY(cust_id)DEFERRABLEINITIALLYDEFERREDINSERT
INTOcustVALUES(1,RAJ)row1
INSERTINTOcustVALUES(1,SAM)row2
COMMIT
SETCONSTRAINTcust_id_pkIMMEDIATE
INSERTINTOcustVALUES(1,LATA)row3
INSERTINTOcustVALUES(2,KING)row4
COMMIT
WhichrowswouldbemadepermanentintheCUSTtable?
A.
row4only
B.
rows2and4
C.
rows3and4

D.
rows1and4
Whichoptionwouldbethecorrectformatintheoutput?
PostedbyadminonNovember11,2011
http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

3comments
24/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

ViewtheExhibitandexaminethedetailsoftheEMPLOYEEStable.

EvaluatethefollowingSQLstatement:
SELECTphone_number,
REGEXP_REPLACE(phone_number,'([[:digit:]]{3}).([[:digit:]]{3}).([[:digit:]]{4}),(\1)\2\3)PHONENUMBER
FROMemployees
ThequerywaswrittentoformatthePHONE_NUMBERfortheemployees.
Whichoptionwouldbethecorrectformatintheoutput?
A.
xxxxxxxxxx
B.
(xxx)xxxxxxx
C.
(xxx)xxxxxxx

D.
xxx(xxx)xxxx
Whatwouldhappenwhentheabovestatementisexecuted?
PostedbyadminonNovember11,2011

3comments

ViewtheExhibitandexaminePRODUCTSandORDER_ITEMStables.

YouexecutedthefollowingquerytodisplayPRODUCT_NAMEandthenumberoftimestheproducthasbeenordered:
SELECTp.product_name,i.item_cnt
FROM(SELECTproduct_id,COUNT(*)item_cnt
FROMorder_items
GROUPBYproduct_id)iRIGHTOUTERJOINproductspONi.product_id=p.product_id
Whatwouldhappenwhentheabovestatementisexecuted?
A.
Thestatementwouldexecutesuccessfullytoproducetherequiredoutput.

B.
Thestatementwouldnotexecutebecauseinlineviewsandouterjoinscannotbeusedtogether.
C.
ThestatementwouldnotexecutebecausetheITEM_CNTaliascannotbedisplayedintheouterquery.
http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

25/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

D.
ThestatementwouldnotexecutebecausetheGROUPBYclausecannotbeusedintheinlineview.
WhichCREATEVIEWstatementwouldcreatetheviewsuccessfully?
PostedbyadminonNovember11,2011

7comments

ViewtheExhibitandexaminethedatainORDERSandORDER_ITEMStables.

YouneedtocreateaviewthatdisplaystheORDERID,ORDER_DATE,andthetotalnumberofitemsineachorder.
WhichCREATEVIEWstatementwouldcreatetheviewsuccessfully?
A.
CREATEORREPLACEVIEWord_vu(order_id,order_date)ASSELECTo.order_id,o.order_date,COUNT(i.line_item_id)NOOFITEMSFROMorderso
JOINorder_itemsi
ON(o.order_id=i.order_id)
GROUPBYo.order_id,o.order_date
B.
CREATEORREPLACEVIEWord_vu
ASSELECTo.order_id,o.order_date,COUNT(i.line_item_id)NOOFITEMSFROMordersoJOINorder_itemsi
ON(o.order_id=i.order_id)
GROUPBYo.order_id,o.order_date

C.
CREATEORREPLACEVIEWord_vu
ASSELECTo.order_id,o.order_date,COUNT(i.line_item_id)FROMordersoJOINorder_itemsi
ON(o.order_id=i.order_id)
GROUPBYo.order_id,o.order_date
D.
CREATEORREPLACEVIEWord_vu
ASSELECTo.order_id,o.order_date,COUNT(i.line_item_id)||NOOFITEMSFROMordersoJOINorder_itemsi
ON(o.order_id=i.order_id)
GROUPBYo.order_id,o.order_date
WITHCHECKOPTION
WhichisthebestmethodtoloaddatafromtheMARKS_DETAILStabletotheMARKStable?
PostedbyadminonNovember11,2011

2comments

ViewtheExhibitandexaminethestructureoftheMARKS_DETAILSandMARKStables.

http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

26/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

WhichisthebestmethodtoloaddatafromtheMARKS_DETAILStabletotheMARKStable?
A.
PivotingINSERT

B.
UnconditionalINSERT
C.
ConditionalALLINSERT
D.
ConditionalFIRSTINSERT
WhichSQLclausewouldletyouchoosethedirectiontowalkthroughthehierarchytree?
PostedbyadminonNovember11,2011

Nocomments

ViewtheExhibitandexaminethestructureoftheEMPLOYEEStable.

Youwanttoretrievehierarchicaldataoftheemployeesusingthetopdownhierarchy.WhichSQLclausewouldletyouchoosethedirectiontowalkthroughthe
hierarchytree?
A.
WHERE
B.
HAVING
C.
GROUPBY
D.
STARTWITH
E.
CONNECTBYPRIOR

Page2of4

Questions&Answercollection.

http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

27/28

1/13/2015

1Z0047|OracleQuestions&AnswersPart2

http://www.aiotestking.com/oracle/category/single/oracledbsqlexpert/page/2/

28/28

You might also like