1z0-047 Premium Bundle

1z0-047 Premium Bundle

Oracle Database SQL Expert Certification Exam

4.5 
(585 ratings)
0 QuestionsPractice Tests
0 PDFPrint version
May 20, 2024Last update

Oracle 1z0-047 Free Practice Questions

Q1. 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

Q2. Which SQL statement would display the view names and definitions of all the views owned by you? 

A. SELECTviewjiame, text FROM user_view; 

B. SELECTviewjiame, text FROM user_object; 

C. SELECTviewjiame, text FROM user_objects; 

D. SELECTview_name, text FROM user views; 

Answer: D

Q3. 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

Q4. View the Exhibit and examine the description of EMPLOYEES and DEPARTMENTS tables. 

You want to display the EMPLOYEE_ID, LAST_NAME, and SALARY for the employees who get the maximum salary in their respective departments. The following SQL statement was written: 

WITH 

SELECT employee_id, last_name, salary 

FROM employees 

WHERE (department_id, salary) = ANY (SELECT* 

FROM dept_max) 

dept_max as (SELECT d.department_id, max(salary) 

FROM departments d JOIN employees j 

ON (d. department_id = j. department_id) 

GROUP BY d. department_id); 

Which statement is true regarding the execution and the output of this statement? 

A. The statementwouldexecute and give the desired results. 

B. Thestatement wouldnotexecute becausethe= ANY comparison operator is used instead of=. 

C. Thestatement wouldnot execute because themain queryblock usesthequery name beforeitis even created. 

D. The statement wouldnot execute because the commaismissing betweenthemain query block and the query name. 

Answer: C

Q5. Evaluate the following ALTER TABLE statement: 

ALTER TABLE orders 

SET UNUSED order_date; 

Which statement is true? 

A. The DESCRIBE command would still display the ORDER_DATE column. 

B. ROLLBACK can be used to get back the ORDER_DATE column in the ORDERS table. 

C. The ORDER_DATE column should be empty for the ALTER TABLE command to execute successfully. 

D. After executing the ALTER TABLE command, you can add a new column called ORDER_DATE to the ORDERS table. 

Answer: D

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

You executed the following SQL statement: 

SELECT first_name, department_id, salary 

FROM employees 

ORDER BY department_id, first_name, salary desc; 

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

A. The valuesinall the columns wouldbe sortedin the descending order. 

B. Thevalues in theSALARYcolumn wouldbesorted indescendingorder for all the employees havingthesame valueinthe DEPARTMENT_ID column. 

C. The values intheFIRST_NAME column would be sortedinascending order for alltheemployees having the same valueinthe DEPARTMENT_ID column. 

D. Thevalues in the FIRST_NAME column would be sorted in the descendingorder forall the employees having the same valueinthe DEPARTMENT_ID column. 

E. Thevalues in the SALARY column wouldbe sortedin descending order foralltheemployeeshaving thesame value intheDEPARTMENT_IDandFIRST_NAME column. 

Answer: CE

Q7. View the Exhibit and examine the data in the EMPLOYEES tables. 

Evaluate the following SQL statement: SELECT employee_id, department_id FROM employees WHERE department_id= 50 ORDER BY department_id UNION SELECT employee_id, department_id FROM employees WHERE department_id= 90 UNION SELECT employee_id, department_id FROM employees WHERE department_id= 10; What would be the outcome of the above SQL statement? 

A. The statementwouldexecute successfullyanddisplay all the rows intheascending order of DEPARTMENT_ID. 

B. Thestatement would execute successfullybutitwillignoretheORDERBYclause and display the rows in random order. 

C. The statementwouldnot execute because the positional notationinstead of thecolumn name shouldbeusedwiththe ORDER BY clause. 

D. The statement would not execute because the ORDER BY clause should appear only at the end of the SQL statement, that is, in the last SELECT statement. 

Answer: D

Q8. Which statement is true regarding the CUBE operator in the GROUP BY clause of a SQL statement? 

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

B. It finds all the NULL values in the superaggregates for the groups specified in the GROUP BY clause. 

C. It produces 2 n possible superaggregate combinations, if the n columns and expressions are specified in the GROUP BY clause. 

D. It produces n+1 possible superaggregate combinations, if the n columns and expressions are specified in the GROUP BY clause. 

Answer: C

Q9. View the Exhibit and examine the structure of the MARKS_DETAILS and MARKStables. 

Which is the best method to load data from the MARKS DETAILStable to the MARKStable? 

A. Pivoting INSERT 

B. Unconditional INSERT 

C. Conditional ALL INSERT 

D. Conditional FIRST INSERT 

Answer: A

Q10. View the Exhibit and examine the details for the CATEGORIES_TAB table. 

Evaluate the following incomplete SQL statement: 

SELECT category_name ,category_description 

FROM categories_tab 

You want to display only the rows that have 'harddisks' as part of the string in the CATEGORY_DESCRIPTION column. 

Which two WHERE clause options can give you the desired result? (Choose two.) 

A. WHEREREGEXP_LIKE(category_description, 'hard+.s’); 

B. WHERE REGEXP_LIKE(category_description,‘^H|hard+.s’); 

C. WHERE REGEXP_LIKE (category_description, '^H|hard+.s$'); 

D. WHEREREGEXP_LIKE (category_description, '[^Hlhard+.s]'); 

Answer: AB

Q11. Evaluate the following statements: 

CREATE TABLE digits 

(id NUMBER(2), 

description VARCHAR2(15)); 

INSERT INTO digits VALUES (1,'ONE’); 

UPDATE digits SET description =TWO'WHERE id=1; 

INSERT INTO digits VALUES (2.’TWO’); 

COMMIT; 

DELETE FROM digits; 

SELECT description FROM digits 

VERSIONS BETWEEN TIMESTAMP MINVALUE AND MAXVALUE; 

What would be the outcome of the above query? 

A. Itwouldnot display any values. 

B. It would displaythevalue TWO once. 

C. Itwould display the valueTWOtwice. 

D. Itwould display the values ONE, TWO, andTWO. 

Answer: C

Q12. You need to create a table for a banking application with the following considerations: 

1) You want a column in the table to store the duration of the credit period. 

2) The data in the column should be stored in a format such that it can be easily added and subtracted with 3) date type data without using the conversion functions. 

4) The maximum period of the credit provision in the application is 30 days. 

5) The interest has to be calculated for the number of days an individual has taken a credit for. 

Which data type would you use for such a column in the table? 

A. INTERVAL YEAR TOMONTH 

B. INTERVALDAYTO SECOND 

C. TIMESTAMP WITHTIMEZONE 

D. TIMESTAMP WITH LOCAL TIME ZONE 

Answer: B

Q13. View the Exhibit and examine the structure of the CUST table. 

Evaluate the following SQL statements executed in the given order: 

ALTER TABLE cust 

ADD CONSTRAINT cust_id_pk PRIMARY KEY(cust_id) DEFERRABLE INITIALLY DEFERRED; 

INSERT INTO cust VALUES (1 /RAJ1); --row 1 

INSERT INTO cust VALUES (1 ,'SAM); --row 2 

COMMIT; 

SET CONSTRAINT cust_id_pk IMMEDIATE; 

INSERT INTO cust VALUES (1 /LATA1); --row 3 

INSERT INTO cust VALUES (2 .KING1); --row 4 

COMMIT; 

Which rows would be made permanent in the CUST table? 

A. row4only 

B. rows 2 and 4 

C. rows 3 and 4 

D. rows1and 4 

Answer: C

Q14. Which two statements are true about the GROUPING function? (Choose two.) 

A. Itis used to find the groups forming the subtotal in a row. 

B. It is used to identify the NULL value in the aggregate functions. 

C. It is used to form the group sets involved in generating the totals and subtotals. 

D. It can only be used with ROLLUP and CUBE operators specified in the GROUP BY clause. 

Answer: A,D

Q15. Which statements are correct regarding indexes? (Choose all that apply.) 

A. When a table is dropped, the corresponding indexes are automatically dropped. 

B. For each DML operation performed, the corresponding indexes are automatically updated. 

C. Indexes should be created on columns that are frequently referenced as part of an expression. 

D. A non-deferrable PRIMARY KEY or UNIQUE KEY constraint in a table automatically creates a unique index. 

Answer: ABD

START 1z0-047 EXAM