1z0-071 Practice Test Questions

360 Questions


Which two statements are true regarding the EXISTS operator used in the correlated subqueries? (Choose two.)


A.

The outer query stops evaluating the result set of the inner query when the first value is
found.


B.

It is used to test whether the values retrieved by the inner query exist in the result of the
outer query.


C.

It is used to test whether the values retrieved by the outer query exist in the result set of
the inner query.


D.

The outer query continues evaluating the result set of the inner query until all the values
in the result set are processed.





A.
  

The outer query stops evaluating the result set of the inner query when the first value is
found.



C.
  

It is used to test whether the values retrieved by the outer query exist in the result set of
the inner query.



http://www.techonthenet.com/oracle/exists.php

Examine the structure of the ORDERS table: (Choose the best answer.)

You want to find the total value of all the orders for each year and issue this command:
SQL> SELECT TO_CHAR(order_date,'rr'), SUM(order_total) FROM orders
GROUP BY TO_CHAR(order_date, 'yyyy');
Which statement is true regarding the result?


A.

It executes successfully but does not give the correct output.


B.

It executes successfully but gives the correct output.


C.

It returns an error because the TO_CHAR function is not valid.


D.

It return an error because the datatype conversion in the SELECT list does not match
the data type conversion in the GROUP BY clause.





D.
  

It return an error because the datatype conversion in the SELECT list does not match
the data type conversion in the GROUP BY clause.



Examine the structure of the Books_TRANSACTIONS table:

Examine the SQl statement:
SQL> SELECT * FROM books_transactions WHERE brrrowed_data<SYSDATE AND
transaction_type=’RM’ OR MEMBER_ID IN
(‘A101; ‘A102’);
Which statement is true about the outcome?


A.

It displays details only for the members who have borrowed before today with RM as
TRANSACTION_TYPE.


B.

It displays details for members who have borrowed before today’s with either RM as
TRANSACTION_TYPE or MEMBER_ID as A101 and A102.


C.

It displays details for only member A101 and A102 have borrowed before today with RM
as TRANSACTION-TYPE.


D.

It displays details for members who have borrowed today with RM as
TRANSACTION_TYPE and details for member A101 or A102.





A.
  

It displays details only for the members who have borrowed before today with RM as
TRANSACTION_TYPE.



View the exhibit and examine the data in the PROJ_TASK_DETAILS table. (Choose the
best answer.)

The PROJ_TASK_DETAILS table stores information about project tasks and the relation
between them.
The BASED_ON column indicates dependencies between tasks.
Some tasks do not depend on the completion of other tasks.
You must generate a report listing all task IDs, the task ID of any task upon which it
depends and the name of the employee in charge of the task upon which it depends.
Which query would give the required result?


A.

SELECT p.task_id, p.based_on, d.task_in_chargeFROM proj_task_details p JOIN
proj_task_details dON (p.task_id = d.task_id);


B.

SELECT p.task_id, p.based_on, d.task_in_chargeFROM proj_task_details p FULL
OUTER JOIN proj_task_details dON (p.based_on = d.task_id);


C.

SELECT p.task_id, p.based_on, d.task_in_chargeFROM proj_task_details p JOIN
proj_task_details dON (p.based_on = d.task_id);


D.

SELECT p.task_id, p.based_on, d.task_in_chargeFROM proj_task_details p LEFT
OUTER JOIN proj_task_details dON (p.based_on = d.task_id);





D.
  

SELECT p.task_id, p.based_on, d.task_in_chargeFROM proj_task_details p LEFT
OUTER JOIN proj_task_details dON (p.based_on = d.task_id);



Which two statements are true regarding constraints?


A.

A table can have only one primary key and one foreign key.


B.

A table can have only one primary key but multiple foreign keys.


C.

Only the primary key can be defined at the column and table levels.


D.

The foreign key and parent table primary key must have the same name.


E.

Both primary key and foreign key constraints can be defined at both column and table





B.
  

A table can have only one primary key but multiple foreign keys.



E.
  

Both primary key and foreign key constraints can be defined at both column and table



Which statement is true regarding the UNION operator?


A.

By default, the output is not sorted.


B.

Null values are not ignored during duplicate checking.


C.

Names of all columns must be identical across all select statements.


D.

The number of columns selected in all select statements need not be the same





B.
  

Null values are not ignored during duplicate checking.



You must create a table EMPLOYEES in which the values in the columns
EMPLOYEES_ID and LOGIN_ID must be unique and not null. (Choose two.)
Which two SQL statements would create the required table?


A.

CREATE TABLE employees(employee_id NUMBER,Login_id
NUMBER,Employee_name VARCHAR2(100),Hire_date DATE,CONSTRAINT
emp_id_ukUNIQUE (employee_id, login_id));


B.

CREATE TABLE employees(employee_id NUMBER,login_id
NUMBER,employee_name VARCHAR2(25),hire_date DATE,CONSTRAINT emp_id_pk
PRIMARY KEY (employee_id, login_id));


C.

CREATE TABLE employees(employee_id NUMBER CONSTRAINT emp_id_pk
PRIMARY KEY, Login_id NUMBER UNIQUE, Employee_name VARCHAR2(25),Hire_date
DATE);


D.

CREATE TABLE employees(employee_id NUMBER,Login_id
NUMBER,Employee_name VARCHAR2(100),Hire_date DATE,CONSTRAINT emp_id_uk
UNIQUE (employee_id, login_id);CONSTRAINT emp_id_nn NOT NULL (employee_id,
login_id));


E.

CREATE TABLE employees(employee_id NUMBER CONSTRAINT emp_id_nn NOT
NULL, Login_id NUMBER CONSTRAINT login_id_nn NOT NULL,Employee_name
VARCHAR2(100),Hire_date DATE,CONSTRAINT emp_id_ukUNIQUE (employee_id,
login_id));





B.
  

CREATE TABLE employees(employee_id NUMBER,login_id
NUMBER,employee_name VARCHAR2(25),hire_date DATE,CONSTRAINT emp_id_pk
PRIMARY KEY (employee_id, login_id));



E.
  

CREATE TABLE employees(employee_id NUMBER CONSTRAINT emp_id_nn NOT
NULL, Login_id NUMBER CONSTRAINT login_id_nn NOT NULL,Employee_name
VARCHAR2(100),Hire_date DATE,CONSTRAINT emp_id_ukUNIQUE (employee_id,
login_id));



The BOOKS_TRANSACTIONS table exists in your database.
SQL>SELECT * FROM books_transactions ORDER BY 3;
What is the outcome on execution?


A.

The execution fails unless the numeral 3 in the ORDER BY clause is replaced by a
column name.


B.

Rows are displayed in the order that they are stored in the table only for the three rows
with the lowest values in the key column.


C.

Rows are displayed in the order that they are stored in the table only for the first three
rows.


D.

Rows are displayed sorted in ascending order of the values in the third column in the
table.





D.
  

Rows are displayed sorted in ascending order of the values in the third column in the
table.



View the Exhibits and examine PRODUCTS and SALES tables.

You issue the following query to display produce name and the number of times the
product has been sold:
SQL>SLECT p. PROD_name, i . item _cnt
FROM (SELECT prod_id =, count (*) item_cnt
FROMm sales
GROUP BY prod_id) I RIGHT OUTER JION products p
On i. prod _id =.prod_id;
What happens when the above statement is executed?


A.

the statement executes successfully and produces the required output.


B.

The statement produce an error because a subquery in the FROM clause and outerjions
cannot be together.


C.

The statement produces an error because the GROUP By clause cannot be usesd in a
subquery in the FROM clause.


D.

The statement produces an error ITEM_CNT cannot be displayed in the outer query.





A.
  

the statement executes successfully and produces the required output.



View the Exhibit and examine the structure of the PORDUCT_INFORMATION table.
(Choose the best answer.)

PRODUCT_ID column is the primary key.
You create an index using this command:
SQL > CREATE INDEX upper_name_idx
ON product_information(UPPER(product_name));
No other indexes exist on the PRODUCT_INFORMATION table.
Which query would use the UPPER_NAME_IDX index?


A.

SELECT product_id, UPPER(product_name)FROM product_informationWHERE
UPPER(product_name) = 'LASERPRO' OR list_price > 1000;


B.

SELECT UPPER(product_name)FROM product_information;


C.

SELECT UPPER(product_name)FROM product_informationWHERE product_id = 2254;


D.

SELECT product_idFROM product_informationWHERE UPPER(product_name) IN
('LASERPRO', 'CABLE');





D.
  

SELECT product_idFROM product_informationWHERE UPPER(product_name) IN
('LASERPRO', 'CABLE');



Which statement correctly grants a system privilege?


A.

GRANT CREATE VIEWON table1 TOuser1;


B.

GRANT ALTER TABLETO PUBLIC;


C.

GRANT CREATE TABLETO user1, user2;


D.

GRANT CREATE SESSIONTO ALL;





C.
  

GRANT CREATE TABLETO user1, user2;



View the exhibit and examine the ORDERS table.
ORDERS
Name
Null?
Type
ORDER ID
NOT NULL
NUMBER(4)
ORDATE DATE
DATE
CUSTOMER ID
NUMBER(3)
ORDER TOTAL
NUMBER(7,2)
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 ordersMODIFY CONSTRAINT orders_cust_id_nn NOT NULL
(customer_id);


B.

ALTER TABLE ordersADD CONSTRAINT orders_cust_id_nn NOT NULL (customer_id);


C.

ALTER TABLE ordersMODIFY customer_id CONSTRAINT orders_cust_nn NOT NULL
(customer_id);


D.

ALTER TABLE ordersADD customer_id NUMBER(6)CONSTRAINT orders_cust_id_nn
NOT NULL;





C.
  

ALTER TABLE ordersMODIFY customer_id CONSTRAINT orders_cust_nn NOT NULL
(customer_id);




Page 12 out of 30 Pages
Previous