Oracle 1Z0-071 Exam (page: 8)
Oracle Database SQL
Updated on: 01-Sep-2025

Viewing Page 8 of 77

Examine the structure of the BOOKS_TRANSACTIONS table:


You want to display the member IDs, due date, and late fee as $2 for all transactions.
Which SQL statement must you execute?

  1. SELECT member_id AS MEMBER_ID, due_date AS DUE_DATE, $2 AS LATE_FEE FROM
    BOOKS_TRANSACTIONS;
  2. SELECT member_id 'MEMBER ID', due_date 'DUE DATE', '$2 AS LATE FEE' FROM BOOKS_TRANSACTIONS;
  3. SELECT member_id AS "MEMBER ID", due_date AS "DUE DATE", '$2' AS "LATE FEE"
    FROM BOOKS_TRANSACTIONS;
  4. SELECT member_id AS "MEMBER ID", due_date AS "DUE DATE", $2 AS "LATE FEE" FROM BOOKS_TRANSACTIONS;

Answer(s): C



In which three situations does a transaction complete?

  1. when a PL/SQL anonymous block is executed
  2. when a DELETE statement is executed
  3. when a ROLLBACK command is executed
  4. when a data definition language (DDL) statement is executed
  5. when a TRUNCATE statement is executed after the pending transaction

Answer(s): C,D,E


Reference:

https://docs.oracle.com/cd/B19306_01/server.102/b14220/transact.htm



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?

  1. The ORDERS_MASTER table would contain the ORDER_IDs 1, 2, 3 and 4.
  2. The ORDERS_MASTER table would contain the ORDER_IDs 1, 2 and 4.
  3. The ORDERS_MASTER table would contain the ORDER_IDs 1, 2 and 3.
  4. The ORDERS_MASTER table would contain the ORDER_IDs 1 and 2.

Answer(s): B


Reference:

https://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9016.htm



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?

  1. Remove the single quotation marks enclosing the character literal string in the SELECT clause
  2. Use the escape character to negate the single quotation mark within the literal character string in the SELECT clause
  3. Enclose the character literal string in the SELECT clause within double quotation marks
  4. Use the Oracle (q) operator and delimiter to allow the use of a single quotation mark within the literal character string in the SELECT clause

Answer(s): D


Reference:

http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements003.htm



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?

  1. ALTER TABLE orders
    MODIFY CONSTRAINT orders_cust_id_nn NOT NULL (customer_id);
  2. ALTER TABLE orders
    ADD CONSTRAINT orders_cust_id_nn NOT NULL (customer_id);
  3. ALTER TABLE orders
    MODIFY customer_id CONSTRAINT orders_cust_nn NOT NULL (customer_id);
  4. ALTER TABLE orders
    ADD customer_id NUMBER(6)CONSTRAINT orders_cust_id_nn NOT NULL;

Answer(s): C



Viewing Page 8 of 77



Share your comments for Oracle 1Z0-071 exam with other users:

Saravana Kumar TS 12/8/2023 9:49:00 AM

question: 93 which statement is true regarding the result? sales contain 6 columns and values contain 7 columns so c is not right answer.
INDIA