Oracle Database SQL Expert - 1Z1-047 Exam Practice Test

View the Exhibit and examine the structure of the ORDERS table. Which task would require subqueries?
Correct Answer: A Vote an answer
View the Exhibit and examine the description of the PRODUCT_INFORMATION table.
Which SQL statement would retrieve from the table the number of products having LIST_PRICE
as NULL?
Correct Answer: A Vote an answer
View the Exhibit and examine the descriptions of ORDER_ITEMS and ORDERS tables. You want to display the CUSTOMER_ID, PRODUCT_ID, and total (UNIT_PRICE multiplied by
QUANTITY) for the order placed. You also want to display the subtotals for a CUSTOMER_ID as
well as for a PRODUCT ID for the last six months.
Which SQL statement would you execute to get the desired output?
Correct Answer: C Vote an answer
View the Exhibit and examine the structure of the EMPLOYEES table. You want to display all employees and their managers having 100 as the MANAGER_ID. You
want the output in two columns: the first column would have the LAST_NAME of the managers
and the second column would have LAST_NAME of the employees.
Which SQL statement would you execute?
Correct Answer: C Vote an answer
Given below are the SQL statements executed in a user session:
CREATE TABLE product
(pcode NUMBER(2),
pnameVARCHAR2(10));
INSERT INTO product VALUES(1, 'pen');
INSERT INTO product VALUES (2,'pencil);
SAVEPOINT a;
UPDATE product SET pcode = 10 WHERE pcode = 1;
SAVEPOINT b;
DELETE FROM product WHERE pcode = 2;
COMMIT;
DELETE FROM product WHERE pcode=10;
ROLLBACK TO SAVEPOINT a;
Which statement describes the consequences?
Correct Answer: A Vote an answer
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.)
Correct Answer: B,C Vote an answer
Which three statements indicate the end of a transaction? (Choose three.)
Correct Answer: A,B,C Vote an answer
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.
Correct Answer: A Vote an answer
View the Exhibit and examine the structure of the LOCATIONS and DEPARTMENTS tables.
Which SET operator should be used in the blank space in the following SQL statement to display the cities that have departments located in them?
SELECT location_id, city
FROM locations
SELECT location_id, city FROM locations JOIN departments USING(location_id);
Correct Answer: A Vote an answer
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?
Correct Answer: A Vote an answer
View the Exhibit and examine the structure of ORDERS and CUSTOMERS tables. Which INSERT statement should be used to add a row into the ORDERS table for the customer
whose CUST LAST NAME is Roberts and CREDIT LIMIT is 600?
Correct Answer: A Vote an answer