1z0-047 | Replace Oracle 1z0-047 practice test


Q101. Which three tasks can be performed using regular expression support in Oracle Database 10g? (Choose three.) 

A. it can be used to concatenate two strings. 

B. it can be used to find out the total length of the string. 

C. it can be used for string manipulation and searching operations. 

D. it can be used to format the output for a column or expression having string data. 

E. it can be used to find and replace operations for a column or expression having string data. 

Answer: CDE

Q102. View the Exhibit and examine the structure of the EMP table. 

You executed the following command to add a primary key to the EMP table: 

ALTER TABLE emp 

ADD CONSTRAINT emp_id_pk PRIMARY KEY (emp_id) 

USING INDEX emp_id_idx; 

Which statement is true regarding the effect of the command? 

A. The PRIMARY KEY is created alongwitha new index. 

B. The PRIMARY KEY is created anditwould use an existinguniqueindex. 

C. The PRIMARY KEYwould becreated in a disabled state because it is usinganexisting index. 

D. The statementproduces an error because the USING clause is permitted only intheCREATE TABLE command. 

Answer: B

Q103. View the Exhibit and examine the data in ORDERS_MASTER and MONTHLY_ORDERS tables. 

Evaluate the following MERGE statement: 

MERGE INTO orders_master o USING monthly_orders m ON (o.order_id = m.order_id) WHEN MATCHED THEN UPDATE SET o.order_total = m.order_total DELETE WHERE (m.order_total IS NULL) WHEN NOT MATCHED THEN INSERT VALUES (m.order_id, m.order_total); 

What would be the outcome of the above statement? 

A. The ORDERS_MASTER table would contain the ORDER_IDs 1 and 2. 

B. The ORDERS_MASTER table would contain the ORDER_IDs 1,2 and 3. 

C. The ORDERS_MASTER table would contain the ORDER_IDs 1,2 and 4. 

D. The ORDERS_MASTER table would contain the ORDER IDs 1,2,3 and 4. 

Answer: C

Q104. View the Exhibit and examine the structure of the EMP table. 

You executed the following command to add a primary key to the EMP table: 

ALTER TABLE emp 

ADD CONSTRAINT emp_id_pk PRIMARY KEY (emp_id) 

USING INDEX emp_id_idx; 

Which statement is true regarding the effect of the command? 

A. The PRIMARY KEY is created along with a new index. 

B. The PRIMARY KEY is created and it would use an existing unique index. 

C. The PRIMARY KEY would be created in a disabled state because it is using an existing index. 

D. The statement produces an error because the USING clause is permitted only in the CREATE TABLE command. 

Answer: B

Q105. View the Exhibit and examine the description of the CUSTOMERS table. 

You want to add a constraint on the CUST_FIRST_NAME column of the CUSTOMERS table so that the value inserted in the column does not have numbers. 

Which SOL statement would you use to accomplish the task? 

A. ALTER TABLE CUSTOMERS 

ADD CONSTRAINT cust_f_name CHECK(REGEXP_LIKE(cust_first_name1'^A-Z’))NOVALIDATE; 

B. ALTER TABLE CUSTOMERS

 ADD CONSTRAINT cust_f_name CHECK(REGEXP_LIKE(cust_first_name,'^[0-9]’))NOVALIDATE; 

C. ALTER TABLE CUSTOMERS

 ADD CONSTRAINT cust_f_name CHECK(REGEXP_LIKE(cust_first_name,'[[:alpha: ]]’))NOVALIDATE; 

D. ALTER TABLE CUSTOMERS 

ADD CONSTRAINT cust_f_name CHECK(REGEXP_LIKE(cust_first_name,'[[:digit: ]]’))NOVALIDATE ; 

Answer: C

Q106. View the Exhibit and examine the structure of ORDERS and CUSTOMERS tables. 

Evaluate the following UPDATE statement: 

UPDATE 

(SELECT order_date, order_total, customer_id 

FROM orders) 

SET order_date = 22-mar-2007' 

WHERE customer_id = (SELECT customer_id FROM customers WHERE cust_last_name = 'Roberts'AND Credit_limit = 600); 

Which statement is true regarding the execution of the above UPDATE statement? 

A. Itwouldnot execute becausetwotables cannot be usedin a single UPDATEstatement. 

B. It wouldexecuteandrestrict modifications toonly thecolumns specifiedin theSELECT statement. 

C. It wouldnotexecute becauseasubquery cannot be used in the WHERE clause ofanUPDATE statement. 

D. Itwould not execute becausetheSELECTstatementcannot be used in place of the table name. 

Answer: B

Q107. Which statement correctly grants a system privilege? 

A. GRANT EXECUTE ON prod TO PUBLIC; 

B. GRANT CREATE VIEW ON tablel TO User1; 

C. GRANT CREATE TABLE TO used,user2; 

D. GRANT CREATE SESSION TO ALL; 

Answer: C

Q108. View the Exhibit and examine the details of the EMPLOYEES table. 

Evaluate the following SQL statements: 

Statement 1: 

SELECT employee_id, last_name, job_id, manager_id FROM employees START WITH 

employee_id = 101 

CONNECT BY PRIOR employee_id = manager_id AND manager_id != 108; 

Statement 2: 

SELECT employee_id, last_name, job_id, manager_id 

FROM employees 

WHERE manager_id != 108 

START WITH employee_id = 101 

CONNECT BY PRIOR employee_id = manager_id; 

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

A. Statement 2 would not execute because theWHEREclause condition is not allowed in a statementthathas the START WITH clause. 

B. Theoutput forstatement1 would displaytheemployee withMANAGERJD108 and all the employeesbelowhim or herin thehierarchy. 

C. The output of statement 1 wouldneitherdisplay the employeewithMANAGERJD 108 nor any employee below him or herinthe hierarchy. 

D. The output for statement 2 would not displaytheemployee with MANAGERJD 108 but it would display all the employees belowhimor her in the hierarchy. 

Answer: CD

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

You want to calculate the total remuneration for each employee. Total remuneration is the sum of the annual salary and the percentage commission earned for a year. Only a few employees earn commission. 

Which SOL statement would you execute to get the desired output? 

A. SELECTfirst_name, salary, salary*12+salary*commission_pct "Total" 

FROM EMPLOYEES; 

B. SELECTfirst_name,salary, salary*12+NVL((salary*commission_pct), 0) "Total" 

FROMEMPLOYEES; 

C. SELECTfirst_name, salary, salary*12 + NVL(salary, O)*commission_pct "Total" 

FROM EMPLOYEES; 

D. SELECTfirst_name, salary, salary*12+(salary*NVL2(commission_pct, 

salary,salary+commission_pct))"Total" 

FROM EMPLOYEES; 

Answer: B

Q110. View the Exhibit and examine the structure of the ORDERS table. Which task would require subqueries? 

A. displaying the total order value for sales representatives 161 and 163 

B. displaying the order total for sales representative 161 in the year 1999 

C. displaying the number of orders that have order mode online and order date in 1999 

D. displaying the number of orders whose order total is more than the average order total for all online orders 

Answer: D