1z0-047 | Realistic Oracle 1z0-047 exam


Q91. View the Exhibit and examine the data in the DEPARTMENTS tables. 

Evaluate the following SQL statement: 

SELECT department_id "DEPT_ID", department_name , 'b' FROM departments WHERE department_id=90 UNION SELECT department_id, department_name DEPT_NAME, 'a' FROM departments WHERE department_id=10 

Which two ORDER BY clauses can be used to sort the output of the above statement? (Choose two.) 

A. ORDERBY 3; 

B. ORDER BY 'b' 

C. ORDER BY DEPT_ID; 

D. ORDER BY DEPT NAME; 

Answer: AC

Q92. View the Exhibit and examine the description of the EMPLOYEES table. 

You want to display the EMPLOYE_ID, FIRST_NAME, and DEPARTMEN_ID for all the employees who work in the same department and have the same manager as that of the employee having EMPLOYE_ID 104. To accomplish the task, you execute the following SQL statement: 

SELECT employee_id, first_name, department_id 

FROM employees 

WHERE (manager_id, department_id) =(SELECT department_id, manager_id FROM employees WHERE employee_id = 104) 

AND employee_id <> 104; 

When you execute the statement it does not produce the desired output. What is the reason for this? 

A. The WHERE clause condition in the main query is using the = comparison operator, instead of EXISTS. 

B. TheWHERE clause condition in themainquery is usingthe= comparison operator,insteadof theINoperator. 

C. The WHERE clause condition in themainquery is using the=comparison operator,insteadof the =ANYoperator. 

D. The columns in the WHERE clause condition of the main query andthecolumns selected inthesubquery should be in the same order. 

Answer: D

Q93. Which statement is true regarding the ROLLUP operator specified in the GROUP BY clause of a SQL statement? 

A. It produces only the subtotals for the groups specified in the GROUP BY clause. 

B. It produces only the grand totals for the groups specified in the GROUP BY clause. 

C. It produces higher-level subtotals, moving from right to left through the list of grouping columns specified in the GROUP BY clause. 

D. It produces higher-level subtotals, moving in all the directions through the list of grouping columns specified in the GROUP BY clause. 

Answer: C

Q94. Which statements are true regarding the hierarchical query in Oracle Database 10g? (Choose all that apply.) 

A. It is possible to retrieve data only in top-down hierarchy. 

B. Itis possible to retrieve data in top-down or bottom-up hierarchy. 

C. It is possible to remove an entire branch from the output of the hierarchical query. 

D. You cannot specify conditions when you retrieve data by using a hierarchical query. 

Answer: BC

Q95. A non-correlated subquery can be defined as________ . 

A. a set of sequential queries, all of which must always return a single value 

B. a set of sequential queries, all of which must return values from the same table 

C. a SELECT statement that can be embedded in a clause of another SELECT statement only 

D. a set of one or more sequential queries in which generally the result of the inner query is used as the search value in the outer query 

Answer: D

Q96. Evaluate the following command: 

CREATE TABLE employees (employee_id NUMBER(2) PRIMARY KEY, last_name VARCHAR2(25) NOT NULL, department_id NUMBER(2), job_id VARCHAR2(8), salary NUMBER(10,2)); 

You issue the following command to create a view that displays the IDs and last names of the sales staff in the organization: 

CREATE OR REPLACE VIEW sales_staff_vu AS SELECT employee_id, last_name job_id FROM employees WHERE job_id LIKE 'SA_%' WITH CHECK OPTION; 

Which statements are true regarding the above view? (Choose all that apply.) 

A. It allows you to insert details of allnewstaff into the EMPLOYEES table. 

B. Itallowsyou todeletethedetails of the existing sales staff fromtheEMPLOYEES table. 

C. It allows you to updatethejob ids oftheexisting sales staff to any other job id in the EMPLOYEES table. 

D. It allows you to insert the IDs, last names and job ids of the sales staff from theviewif it is used in multitable INSERT statements. 

Answer: BD

Q97. View the Exhibit and examine the descriptions of the EMPLOYEES and DEPARTMENTS tables. 

The following SQL statement was executed: 

SELECT e.department_id, e.job_id, d.location_id, sum(e.salary) total, 

GROUPING(e. department_id) GRP_DEPT, 

GROUPING(e.job_id) GRPJOB, 

GROUPING(d. location_id) GRP_LOC 

FROM employees e JOIN departments d 

ON e.department_id = d.department_id 

GROUP BY ROLLUP (e.department_id, e.job_id, d.location_id); 

View the Exhibit2 and examine the output of the command. 

Which two statements are true regarding the output? (Choose two.) 

A. The value1in GRP_LOC means that the LOCATION_ID column is taken into account to generate the subtotal. 

B. The value 1 in GRPJOBandGRP_LOC meansthatJOB_IDandLOCATION_ID columns are nottakeninto accountto generatethesubtotal. 

C. Thevalue1inGRPJOB and GRP_LOC meansthatthe NULL value in JOBJD and LOCATIONJD columns aretakeninto account togeneratethe subtotal. 

D. The value 0 inGRP_DEPT,GRPJOB, and GRP_LOC means that DEPARTMENT_ID, JOB_ID, and LOCATION_ID columnsaretaken into account to generate the subtotal 

Answer: BD

Q98. View the Exhibit and examine the description of the EMPLOYEES table. 

Evaluate the following SQL statement: 

SELECTfirst_name, employee_id, NEXr_DAY(ADD_MONTHS(hire_date, 6), 1) "Review" FROM employees; 

The query was written to retrieve the FIRST_NAME, EMPLOYEE_ID, and review date for employees. The review date is the first Monday after the completion of six months of the hiring. The 

NLS_TERRITORY parameter is set to AMERICA in the session. Which statement is true regarding this query? 

A. The query would execute to give the desired output. 

B. The query would not execute because date functions cannot be nested. 

C. The query would execute but the output would give review dates that are Sundays. 

D. The query would not execute because the NEXT_DAY function accepts a string as argument. 

Answer: C

Q99. ORD is a private synonym for the OE.ORDERS table. 

The user OE issues the following command: 

DROP SYNONYM ord; 

Which statement is true regarding the above SOL statement? 

A. Onlythesynonymwould be dropped. 

B. The synonym would be dropped and the corresponding table would become invalid. 

C. The synonym would be dropped and the packages referring to the synonym would be dropped. 

D. The synonym would be dropped and any PUBLIC synonym with the same name becomes invalid. 

Answer: A

Q100. Given below is a list of functions and their purpose in random order. 

Function Purpose 1)NVL a) Used for evaluating NOT NULL and NULL values 2)NULLIF b) Used to return the first non- null values in a list of expressions 3)COALESCE c) Used 

to compare two expressions. If both are same, it returns NULL; otherwise, it returns only the first expression. 

4)NVL2 d) Used to convert NULL values to actual values 

Identify the correct combination of functions and their usage. 

A. 1-a,2-c,3-b,4-d 

B. 1-d,2-c,3-b,4-a 

C. 1-b,2-c,3-d,4-a 

D. 1-d,2-b,3-c,4-a 

Answer: B