1z0-071 Premium Bundle

1z0-071 Premium Bundle

Oracle Database 12c SQL Certification Exam

4.5 
(7320 ratings)
0 QuestionsPractice Tests
0 PDFPrint version
November 23, 2024Last update

Oracle 1z0-071 Free Practice Questions

Q1. View the Exhibit and examine the ORDERS table.

The ORDERS table contains data and all orders have been assigned a customer ID. Which statement would add a NOT NULL constraint to the CUSTOMER_ID column?

A. ALTER TABLE orders

ADD CONSTRAINT orders_cust_id_nn NOT NULL (customer_id);

B. ALTER TABLE orders

MODIFY customer_id CONSTRAINT orders_cust_id_nn NOT NULL;

C. ALTER TABLE orders

MODIFY CONSTRAINT orders_cust_id_nn NOT NULL (customer_id);

D. ALTER TABLE orders

ADD customer_id NUMBER(6)CONSTRAINT orders_cust_id_nn NOT NULL;

Answer: B

Q2. Examine the following query:

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.

Answer: C

Q3. 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 the table structure.

B. It recovers the table structure, data, and the indexes.

C. It recovers the table structure and data but not the related indexes.

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

Answer: D

Q4. Examine the structure of the members table:

What is the outcome?

A. It fails because the alias name specified after the column names is invalid.

B. It fails because the space specified in single quotation marks after the first two column names is invalid.

C. It executes successfully and displays the column details in a single column with only the alias column heading.

D. It executes successfully and displays the column details in three separate columns and replaces only the last column heading with the alias.

Answer: D

Q5. Which statement is true about transactions?

A. A set of Data Manipulation Language (DML) statements executed in a sequence ending with a SAVEPOINT forms a single transaction.

B. Each Data Definition Language (DDL) statement executed forms a single transaction.

C. A set of DDL statements executed in a sequence ending with a COMMIT forms a single transaction.

D. A combination of DDL and DML statements executed in a sequence ending with a COMMIT forms a single transaction.

Answer: D

Q6. 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?

A. INSERT INTO orders

VALUES (1,'10-mar-2007', 'direct',

(SELECT customer_id FROM customers

WHERE cust_last_name='Roberts' AND credit_limit=600), 1000);

B. INSERT INTO orders (order_id,order_date,order_mode, (SELECT customer_id

FROM customers

WHERE cust_last_name='Roberts' AND credit_limit=600) .order_total)

VALUES(1 ,'10-mar-2007', 'direct', &&customer_id, 1000);

C. INSERT INTO orders (order_id.order_date.order_mode, (SELECT customer_id

FROM customers

WHERE cust_last_name='Roberts' AND credit _limit=600) .order_total)

VALUES(1 ,'IO-mar-2007', 'direct', &customer_id, 1000);

D. INSERT INTO(SELECT o.order_id, o.order_date.o.orde_mode.c.customer_id, o.order_total FROM orders o, customers c

WHERE o.customer_id = c.customer_id

AND c.cust_last_name='Roberts'ANDc. Credit_limit=600) VALUES (1,'10-mar-2007', 'direct',(SELECT customer_id FROM customers

WHERE cust_last_name='Roberts' AND Credit_limit=600), 1000);

Answer: A

Q7. View the Exhibit and examine the structure of ORDERS and ORDER_ITEMS tables.

ORDER ID is the primary key in the ORDERS table. It is also the foreign key in the ORDER_ITEMS table wherein it is created with the ON DELETE CASCADE option.

Which DELETE statement would execute successfully?

A. DELETE order_id FROM orders

WHERE order_total < 1000;

B. DELETE orders

WHERE order_total < 1000;

C. DELETE

FROM orders

WHERE (SELECT order_id FROM order_items);

D. DELETE orders o, order_items i WHERE o.order id = i.order id;

Answer: B

Q8. Examine the structure of the employees table.

There is a parent/child relationship betweenEMPLOYEE_IDandMANAGER_ID.

You want to display the last names and manager IDs of employees who work for the same manager asthe employee whoseEMPLOYEE_ID123.

Which query provides the correct output? 

A)

B)

C)

D)

A. Option A

B. Option B

C. Option C

D. Option D

Answer: B

Q9. Which two statements are true regarding constraints? (Choose two.)

A. A foreign key cannot contain NULL values.

B. A column with the UNIQUE constraint can contain NULL.

C. A constraint is enforced only for the INSERT operation on a table.

D. A constraint can be disabled even if the constraint column contains data.

E. All the constraints can be defined at the column level as well as the table level

Answer: B,D

Q10. Examine the data in the CUST_NAME column of the CUSTOMERS table. CUST_NAME

------------------------

Renske Ladwig Jason Mallin Samuel McCain Allan MCEwen Irene Mikkilineni Julia Nayer

You need to display customers' second names where the second name starts with "Mc" or "MC."

Which query gives the required output?

A. SELECT SUBSTR(cust_name, INSTR(cust_name,' ')+1) FROM customers

WHERE INITCAP(SUBSTR(cust_name, INSTR(cust_name,' ')+1))='Mc'

B. SELECT SUBSTR(cust_name, INSTR(cust_name,' ')+1) FROM customers

WHERE INITCAP(SUBSTR(cust_name, INSTR(cust_name,' ')+1)) LIKE 'Mc%'

C. SELECT SUBSTR(cust_name, INSTR(cust_name,' ')+1) FROM customers

WHERE SUBSTR(cust_name, INSTR(cust_name,' ')+1) LIKE INITCAP('MC%');

D. SELECT SUBSTR(cust_name, INSTR(cust_name,' ')+1) FROM customers

WHERE INITCAP(SUBSTR(cust_name, INSTR(cust_name,' ')+1)) = INITCAP('MC%');

Answer: B

Q11. Which statements are true? (Choose all that apply.)

A. The data dictionary is created and maintained by the database administrator.

B. The data dictionary views can consist of joins of dictionary base tables and user-defined tables.

C. The usernames of all the users including the database administrators are stored in the data dictionary.

D. The USER_CONS_COLUMNS view should be queried to find the names of the columns to which a constraint applies.

E. Both USER_OBJECTS and CAT views provide the same information about all the objects that are owned by the user.

F. Views with the same name but different prefixes, such as DBA, ALL and USER, use the same base tables from the data dictionary

Answer: C,D,F

Q12. Which statements are true regarding the WHERE and HAVING clauses in a SELECT statement?

(Choose all that apply.)

A. The HAVING clause can be used with aggregate functions in subqueries.

B. The WHERE clause can be used to exclude rows after dividing them into groups.

C. The WHERE clause can be used to exclude rows before dividing them into groups.

D. The aggregate functions and columns used in the HAVING clause must be specified in the SELECT list of the query.

E. The WHERE and HAVING clauses can be used in the same statement only if they are applied to different columns in the table.

Answer: A,C

Q13. Evaluate the following SQL statement:

SELECT product_name || 'it's not available for order' FROM product_information

WHERE product_status = 'obsolete'

You received the following error while executing the above query: ERROR:

ORA-01756: quoted string not properly terminated What would you do to execute the query successfully?

A. Enclose the character literal string in the SELECT clause within the double quotation marks.

B. Do not enclose the character literal string in the SELECT clause within the single quotation marks.

C. Use Quote (q) operator and delimiter to allow the use of single quotation mark in the literal character string.

D. Use escape character to negate the single quotation mark inside the literal character string in the SELECT clause.

Answer: C

Q14. View the Exhibit and examine the descriptions of the DEPT and LOCATIOMS 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 SQL statement would you execute to accomplish the task?

A. UPDATE dept d

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

B. UPDATE dept d

SET city = (SELECT city FROM locations l) WHERE d.location_id = l.location_id;

C. UPDATE dept d

SET city = (SELECT city FROM locations l

WHERE d.location_id = l.location_id);

D. UPDATE dept d

SET city = ALL (SELECT city FROM locations l

WHERE d.location_id = l.location_id);

Answer: C

Q15. You want to display 5 percent of the rows from the sales table for products with the lowestAMOUNT_SOLD and also want to include the rows that have the sameAMOUNT_SOLDeven if this causes the output to exceed 5 percent of the rows.

Which query willprovide the required result?

A. SELECT prod_id, cust_id, amount_sold FROM sales

ORDER BY amount_sold

FETCH FIRST 5 PERCENT ROWS WITH TIES;

B. SELECT prod_id, cust_id, amount_sold FROM sales

ORDER BY amount_sold

FETCH FIRST 5 PERCENT ROWS ONLY WITH TIES;

C. SELECT prod_ id, cust_id, amount_sold FROM sales

ORDER BY araount_sold

FETCH FIRST 5 PERCENT ROWS WITH TIES ONLY;

D. SELECT prod_id, cust_id, amount_sold FROM sales

ORDER BY amount sold

FETCH FIRST 5 PERCENT ROWS ONLY;

Answer: B

Q16. Which statement is true regarding the default behavior of the ORDER BY clause?

A. In a character sort, the values are case-sensitive

B. NULL values are not considered at all by the sort operation

C. Only those columns that are specified in the SELECT list can be used in the ORDER BY clause

D. Numeric values are displayed from the maximum to the minimum value if they have decimal positions

Answer: A

Explanation:

Character Strings and Dates

Character strings and date values are enclosed with single quotation marks. Character values are case-sensitive and date values are format-sensitive. The default date display format is DD-MON-RR.

Q17. Examine the command:

What does ON DELETE CASCADE Imply?

A. When the books table is dropped, the BOOK_TRANSACTIONS table is dropped.

B. When the books table is dropped, all the rows in the BOOK_TRANSACTIONS table are deleted but the table structure is retained.

C. When a row in the books table is deleted, the rows in the BOOK TRANSACTIONS table whose BOOK_ID matches that of the deleted row in the books table are also deleted.

D. When a value in the BOOKS.BOOK_ID column is deleted, the corresponding value is updated in the books transactions. BOOK_ID column.

Answer: C

Q18. 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?

A. SELECT m.last_name "Manager", e.last_name "Employee" FROM employees m JOIN employees e

ON m.employee_id = e.manager_id WHERE m.manager_id=100;

B. SELECT m.last_name "Manager", e.last_name "Employee" FROM employees m JOIN employees e

ON m.employee_id = e.manager_id WHERE e.manager_id=100;

C. SELECT m.last_name "Manager", e.last_name "Employee" FROM employees m JOIN employees e

ON e.employee_id = m.manager_id WHERE m.manager_id=100;

D. SELECT m.last_name "Manager", e.last_name "Employee" FROM employees m JOIN employees e

WHERE m.employee_id = e.manager_id AND e.manager_id=100;

Answer: B

START 1z0-071 EXAM