1z0-071 Practice Test Questions

360 Questions


View the exhibit and examine the structure of the STORES table.
STORES table
NameNull?Type
----------- -------
STORE_IDNUMBER
NAMEVARCHAR2(100)
ADDRESSVARCHAR2(200)
CITYVARCHAR2(100)
COUNTRYVARCHAR2(100)
START_DATEDATE
END_DATEDATE
PROPERTY_PRICENUMBER
You want to display the NAME of the store along with the ADDRESS, START_DATE,
PROPERTY_PRICE, and the projected property price, which is 115% of property price.
The stores displayed must have START_DATE in the range of 36 months starting from 01-
Jan-2000 and above.
Which SQL statement would get the desired output?


A.

SELECT name, concat (address| | ','| |city| |', ', country) AS
full_address,start_date,property_price, property_price*115/100FROM storesWHERE
MONTHS_BETWEEN (start_date, '01-JAN-2000') <=36;


B.

SELECT name, concat (address| | ','| |city| |', ', country) AS
full_address,start_date,property_price, property_price*115/100FROM storesWHERE
TO_NUMBER(start_date-TO_DATE('01-JAN-2000','DD-MON-RRRR')) <=36;


C.

SELECT name, address||','||city||','||country AS full_address,start_date,property_price,
property_price*115/100FROM storesWHERE MONTHS_BETWEEN (start_date,
TO_DATE('01-JAN-2000','DD-MON-RRRR')) <=36;


D.

SELECT name, concat (address||','| |city| |', ', country) AS
full_address,start_date,property_price, property_price*115/100FROM storesWHERE
MONTHS_BETWEEN (start_date, TO_DATE('01-JAN-2000','DD-MON-RRRR')) <=36;





D.
  

SELECT name, concat (address||','| |city| |', ', country) AS
full_address,start_date,property_price, property_price*115/100FROM storesWHERE
MONTHS_BETWEEN (start_date, TO_DATE('01-JAN-2000','DD-MON-RRRR')) <=36;



On your Oracle 12c database, you invoked SQL *Loader to load data into the
EMPLOYEES table in the HR schema by issuing the following command:
$> sqlldr hr/hr@pdb table=employees
Which two statements are true regarding the command?


A.

It succeeds with default settings if the EMPLOYEES table belonging to HR is already
defined in the database.


B.

It fails because no SQL *Loader data file location is specified.


C.

It fails if the HR user does not have the CREATE ANY DIRECTORY privilege.


D.

It fails because no SQL *Loader control file location is specified.





A.
  

It succeeds with default settings if the EMPLOYEES table belonging to HR is already
defined in the database.



C.
  

It fails if the HR user does not have the CREATE ANY DIRECTORY privilege.



Evaluate the following two queries:
SQL> SELECT cust_last_name, cust_city
FROM customers
WHERE cust_credit_limit IN (1000, 2000, 3000);
SQL> SELECT cust_last_name, cust_city
FROM customers
WHERE cust_credit_limit = 1000 or cust_credit_limit = 2000 or
cust_credit_limit = 3000
Which statement is true regarding the above two queries?


A.

Performance would improve in query 2 only if there are null values in the
CUST_CREDIT_LIMIT column.


B.

There would be no change in performance.


C.

Performance would degrade in query 2.


D.

Performance would improve in query 2.





B.
  

There would be no change in performance.



http://oraclexpert.com/restricting-and-sorting-data/

View the Exhibit and examine the details of the PRODUCT_INFORMATION table. (Choose
two.)

Evaluate this SQL statement:
SELECT TO_CHAR (list_price, '$9,999')
From product_information;
Which two statements are true regarding the output?


A.

A row whose LIST_PRICE column contains value 11235.90 would be displayed as
#######.


B.

A row whose LIST_PRICE column contains value 1123.90 would be displayed as
$1,123.


C.

A row whose LIST_PRICE column contains value 1123.90 would be displayed as
$1,124.


D.

A row whose LIST_PRICE column contains value 11235.90 would be displayed as
$1,123.





A.
  

A row whose LIST_PRICE column contains value 11235.90 would be displayed as
#######.



C.
  

A row whose LIST_PRICE column contains value 1123.90 would be displayed as
$1,124.



Examine the following query:
SQL> SELECT prod_id, amount_sold
FROM sales
ORDER BY amount_sold
FETCH FIRST 5 PERCENT ROWS ONLY;
What is the output of this query?


A.

It displays 5 percent of the products with the highest amount sold.


B.

It displays the first 5 percent of the rows from the SALES table.


C.

It displays 5 percent of the products with the lowest amount sold.


D.

It results in an error because the ORDER BY clause should be the last clause.





C.
  

It displays 5 percent of the products with the lowest amount sold.



https://oracle-base.com/articles/12c/row-limiting-clause-for-top-n-queries-12cr1

Examine the structure of the INVOICE table.
NameNull?Type
-------------------------
INV_NONOT NULLNUMBER(3)
INV_DATEDATE
INV_AMTNUMBER(10,2)
Which two SQL statements would execute successfully?


A.

SELECT inv_no, NVL2(inv_date, 'Pending', 'Incomplete')FROM invoice;


B.

SELECT inv_no, NVL2(inv_amt, inv_date, 'Not Available')FROM invoice;


C.

SELECT inv_no, NVL2(inv_date, sysdate-inv_date, sysdate)FROM invoice;
;


D.

SELECT inv_no, NVL2(inv_amt, inv_amt*.25, 'Not Available')FROM invoice





A.
  

SELECT inv_no, NVL2(inv_date, 'Pending', 'Incomplete')FROM invoice;



C.
  

SELECT inv_no, NVL2(inv_date, sysdate-inv_date, sysdate)FROM invoice;
;



View the Exhibit and examine the structure of the SALES and PRODUCTS tables. (Choose
two.)

In the SALES table, PROD_ID is the foreign key referencing PROD_ID in the PRODUCTS
table. You must list each product ID and the number of times it has been sold.
Examine this query which is missing a JOIN operator:
SQL > SELECT p.prod_id, count(s.prod_id)
FROM products p ______________ sales s
ON p.prod_id = s.prod_id
GROUP BY p.prod_id;
Which two JOIN operations can be used to obtain the required output?


A.

FULL OUTER JOIN


B.

JOIN


C.

LEFT OUETR JOIN


D.

RIGHT OUTER JOIN





A.
  

FULL OUTER JOIN



C.
  

LEFT OUETR JOIN



View the Exhibit and examine the structures of the employees and departments tables.

You must update the employees table according to these requirements::
-Update only those employees who work in Boston or Seattle (locations 2900 and 2700).
-Set department_id for these employees to the department id corresponding to London
(locationid 2100).
-Set the employees' salary in iocation_id 2100 to 1.1 times the average salary of their
department.
-Set the employees' commission In location_id 2100 to 1.5 times the average commission
of their department.
You issue this command:
What is the result?


A.

It executes successfully but does not produce the desired update.


B.

 It executes successfully and produces the desired update.


C.

It generates an error because multiple columns cannot be specified together in an
UPDATE statement.


D.

It generates an error because a subquery cannot have a join condition in an update
statement.





A.
  

It executes successfully but does not produce the desired update.



View the Exhibit and examine the structure of the PROMOTION table.

You have to generate a report that displays the promo named start data for all promos that
started after that last promo in the ‘INTTERNET’ category.


A.

Select promo_name, promo_being_date FROM promoptions
WHERE promo_being_data > ANY (SELCT promo_being-date
FROM promotions
WHERE promo_category = ‘INTERNET’


B.

SELECT promo_neme, promo_being_date FROM promotions
WHERE promo_being_date > All (SELECT promo_beinjg-date
FROM promotions
WHERE promo_category =’INTERNET’ );


C.

SELECT promo-name, promo-being _date FROM promotions
Where promo_being_data >ALL (SELECT MAX (promo_being-date)
FROM promotions ) AND
Promo-category =’INTERNET’;


D.

SELECT promo-name, promo-being_date FROM promotion
WHERE promo-being-date IN (SELECT promo_biing_date
FROM promotions
WHERE promo_category=’INTYERNET’);





B.
  

SELECT promo_neme, promo_being_date FROM promotions
WHERE promo_being_date > All (SELECT promo_beinjg-date
FROM promotions
WHERE promo_category =’INTERNET’ );



Which statement is true about Enterprise Manager (EM) express in Oracle Database 12c?


A.

By default, EM express is available for a database after database creation.


B.

B. You can use EM express to manage multiple databases running on the same server.


C.

You can perform basic administrative tasks for pluggable databases by using the EM
express interface.


D.

You cannot start up or shut down a database Instance by using EM express.


E.

You can create and configure pluggable databases by using EM express.





A.
  

By default, EM express is available for a database after database creation.



View the Exhibit and examine the structure of the CUSTOMERS table

Using the CUSTOMERS table, you must generate a report that displays a credit limit
increase of 15% for all customers.
Customers with no credit limit should have “Not Available” displayed.
Which SQL statement would produce the required result?


A.

SELECT NVL (TO_CHAR(cust_credit_limit*.15), ‘Not Available’) “NEW CREDIT” FROM
customers


B.

SELECT TO_CHAR(NVL(cust_credit_limit*.15), ‘Not Available’)) “NEW CREDIT” FROM
customers


C.

SELECT NVL (cust_credit_limit*.15, ‘Not Available’) “NEW CREDIT” FROM customers


D.

SELECT NVL (cust_credit_limit, ‘Not Available’)*.15 “NEW CREDIT” FROM customers





C.
  

SELECT NVL (cust_credit_limit*.15, ‘Not Available’) “NEW CREDIT” FROM customers



n the customers table, the CUST_CITY column contains the value 'Paris' for the
CUST_FIRST_NAME 'Abigail'.
Evaluate the following query:

What would be the outcome?


A.

 Abigail PA


B.

Abigail Pa


C.

Abigail IS


D.

An error message





B.
  

Abigail Pa




Page 9 out of 30 Pages
Previous