1z0-047 Premium Bundle

1z0-047 Premium Bundle

Oracle Database SQL Expert Certification Exam

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

Oracle 1z0-047 Free Practice Questions

Q1. View the Exhibit and examine the structure of the EMPLOYEES table. 

You want to know the FIRST_NAME and SALARY for all employees who have the same manager as that of the employee with the first name 'Neena' and have salary equal to or greater than that of'Neena'. 

Which SQL statement would give you the desired result? 

A. SELECTfirst_name, salary FROM employees WHERE (manager_id,salary) >= ALL (SELECT manager_id, salary FROM employees WHERE first_name = 'Neena') AND first_name <> 'Neena' 

B. SELECTfirst_name, salary FROM employees WHERE (manager_id, salary) >= (SELECT manager_id, salary FROM employees WHERE first_name = 'Neena') AND first_name <> 'Neena' 

C. SELECT first_name, salary FROM employees WHERE (manager_id,salary) >= ANY (SELECT manager_id, salary FROM employees WHERE first_name = 'Neena' AND first_name <> 'Neena' 

D. SELECT first_name, salary FROM employees WHERE (manager_id = (SELECT manager_id FROM employees WHERE first_name = 'Neena') AND salary >= (SELECT salary FROM employees WHERE first_name = 'Neena')) AND first name <> 'Neena' 

Answer: D

Q2. View the Exhibit and examine the data in the PRODUCTS table. 

Which statement would add a column called PRICE, which cannot contain NULL? 

A. ALTER TABLE products 

ADD price NUMBER(8,2) NOT NULL; 

B. ALTER TABLE products 

ADD price NUMBER(8,2) DEFAULT NOT NULL; 

C. ALTER TABLE products 

ADD price NUMBER(8,2) DEFAULT 0 NOT NULL; 

D. ALTER TABLE products 

ADD price NUMBER(8,2) DEFAULT CONSTRAINT p_nn NOT NULL; 

Answer: C

Q3. View the Exhibit and examine the descriptions of the DEPT and LOCATIONS tables. 

You want to update the CITY column of the DEPT table for all the rows with the corresponding value in the CITY column of the LOCATIONS table for each department. 

Which SOL statement would you execute to accomplish the task? 

A. UPDATE deptd 

SET city = ANY (SELECT city FROM locations I); 

B. UPDATE deptd 

SET city = (SELECT city 

FROM locations I) 

WHERE d.location_id = l.location_id; 

C. UPDATE deptd 

SET city = (SELECT city 

FROM locations I 

WHERE d.location_id = l.location_id); 

D. UPDATE deptd 

SET city = ALL (SELECT city 

FROM locations I 

WHERE d.location_id = l.location_id); 

Answer: C

Q4. Which two statements are true regarding multiple-row subqueries? (Choose two.) 

A. They can containgroupfunctions. 

B. They always contain a subquery within a subquery. 

C. They use the < ALL operator to imply less than the maximum. 

D. They can be used to retrieve multiple rows from a single table only. 

E. Theyshouldnot be used withthe NOTIN operator inthemainquery if NULLislikelytobea part ofthe result of thesubquery. 

Answer: AE

Q5. 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. WHEREREGEXPJJKE(category_description, 'hard+.s’); 

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

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

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

Answer: AB

Q6. Which two statements are true? (Choose two.) 

A. The USER_SYNONYMSviewcan provide information about private synonyms. 

B. The user SYSTEM owns all the base tables and user-accessible views of the data dictionary. 

C. All the dynamic performance views prefixed with V$ are accessible to all the database users. 

D. The USER_OBJECTS view can provide information about the tables and views created by the user only. 

E. DICTIONARY is a view thatcontains thenamesof allthe datadictionary views that theuser can access. 

Answer: AE

Q7. OE and SCOTT are the users in the database. The ORDERS table is owned by OE. Evaluate the statements issued by the DBA in the following sequence: 

CREATE ROLE r1; 

GRANT SELECT, INSERT ON oe. orders TO r1; 

GRANT r1 TO scott; 

GRANT SELECT ON oe. orders TO scott; 

REVOKE SELECT ON oe.orders FROM scott; 

What would be the outcome after executing the statements? 

A. SCOTT would be able to query the OE.ORDERS table. 

B. SCOTT would not be able to query the OE.ORDERS table. 

C. The REVOKE statement would remove the SELECT privilege from SCOTT as well as from the role R1. 

D. The REVOKE statement would give an error because the SELECT privilege has been granted to the role R1 

Answer: A

Q8. View the Exhibit and examine the data in the PRODUCT_INFORMATION table. 

There are some products listed in the PRODUCT_INFORMATION table that have no value in the 

LIST_PRICE column. You issued the following SQL statement to find out the PRODUCT_NAME 

for these products: 

SELECT product_name, list_price 

FROM product_information WHERE list_price = NULL; 

The query returns no rows. What changes would you make in the statement to get the desired result? 

A. Change the WHERE clause to WHERE list_price = 0 

B. Change the WHERE clause to WHERE list_price = ''. 

C. Change the WHERE clause to WHERE list_price IS NULL. 

D. In the WHERE clause, enclose NULL within single quotation marks. 

E. In the WHERE clause, enclose NULL within double quotation marks. 

Answer: C

Q9. Evaluate the following CREATE SEQUENCE statement: 

CREATE SEQUENCE seql START WITH 100 INCREMENT BY 10 MAXVALUE 200 CYCLE NOCACHE; 

The sequence SEQ1 has generated numbers up to the maximum limit of 200. You issue the following SQL statement: 

SELECT seql.nextval FROM dual; 

What is displayed by the SELECT statement? 

A. 1 

B. 10 

C. 100 

D. an error 

Answer: A

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

Q11. The following are the steps for a correlated subquery, listed in random order: 

1) The WHERE clause of the outer query is evaluated. 

2) The candidate row is fetched from the table specified in the outer query. 

3) The procedure is repeated for the subsequent rows of the table, till all the rows are processed. 

4) Rows are returned by the inner query, after being evaluated with the value from the candidate row in the outer query. Identify the option that contains the steps in the correct sequence in which the Oracle server evaluates a correlated subquery. 

A. 4,2,1,3 

B. 4,1,2,3 

C. 2,4,1,3 

D. 2,1,4,3 

Answer: C

Q12. The first DROP operation is performed on PRODUCTS table using the following command: 

DROP TABLE products PURGE; 

Then you performed the FLASHBACK operation by using the following command: 

FLASHBACK TABLE products TO BEFORE DROP; 

Which statement describes the outcome of the FLASHBACK command? 

A. It recovers only thetablestructure. 

B. It recovers thetablestructure,data,andtheindexes. 

C. It recovers thetablestructure anddatabutnotthe related indexes. 

D. It is not possible to recover the table structure, data, or the related indexes. 

Answer: D

Q13. Which statement is true regarding synonyms? 

A. Synonyms can be created for tables but not views. 

B. Synonyms are used to reference only those tables that are owned by another user. 

C. A public synonym and a private synonym can exist with the same name for the same table. 

D. The DROP SYNONYM statement removes the synonym, and the status of the table on which the synonym has been created becomes invalid. 

Answer: C

Q14. View the Exhibit and examine the description of the PRODUCT_INFORMATION table. 

You want to display the expiration date of the warranty for a product. Which SQL statement would you execute? 

A. SELECT product_id, SYSDATE + warranty_period FROM product_information; 

B. SELECT product_jd, TO_YMINTERVAL(warranty_period) FROM product_information; 

C. SELECT product_id, TO_YMINTERVAL(SYSDATE) + warranty_period FROM product_information; 

D. SELECT product_jd, TO_YMINTERVAL(SYSDATE + warranty_period) FROM product_information; 

Answer: A

Q15. View the Exhibit and examine the structure of the EMPLOYEES table. 

You want to retrieve hierarchical data of the employees using the top-down hierarchy. Which SQL clause would let you choose the direction to walk through the hierarchy tree? 

A. WHERE 

B. HAVING 

C. GROUP BY 

D. START WITH 

E. CONNECT BY PRIOR 

Answer: E

START 1z0-047 EXAM