0% found this document useful (0 votes)
102 views52 pages

Certy: Premium Exam Material

Uploaded by

iamaghoul10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views52 pages

Certy: Premium Exam Material

Uploaded by

iamaghoul10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

Certy IQ

Premium exam material


Get certification quickly with the CertyIQ Premium exam material.
Everything you need to prepare, learn & pass your certification exam easily. Lifetime free updates
First attempt guaranteed success.
https://www.CertyIQ.com
Oracle

(1z0-071)

Oracle Datbase 12c SQL

Total: 374 Questions


Link: https://certyiq.com/papers/oracle/1z0-071
Question: 1 CertyIQ
Examine the description of the PROMOTIONS table:

You want to display the unique promotion costs in each promotion category.
Which two queries can be used? (Choose two.)

A. SELECT DISTINCT promo_category || ' has ' || promo_cost AS COSTS FROM promotions ORDER BY 1;
B. SELECT DISTINCT promo_cost || ' in ' || DISTINCT promo_category FROM promotions ORDER BY 1;
C. SELECT DISTINCT promo_category, promo_cost FROM promotions ORDER BY 1;
D. SELECT promo_category DISTINCT promo_cost, FROM promotions ORDER BY 2;
E. SELECT promo_cost, promo_category FROM promotions ORDER BY 1;

Answer: AC

Explanation:

A. SELECT DISTINCT promo_category || ' has ' || promo_cost AS COSTS FROM promotions ORDER BY 1;

C. SELECT DISTINCT promo_category, promo_cost FROM promotions ORDER BY 1;

Question: 2 CertyIQ
Examine the description of the PRODUCTS table:

Which three queries use valid expressions? (Choose three.)

A. SELECT product_id, unit_price, S "Discount", unit_price + surcharge - discount FROM products;


B. SELECT product_id, (unit_price * 0.15 / (4.75 + 552.25)) FROM products;
C. SELECT product_id, (expiry_date - delivery_date) * 2 FROM products;
D. SELECT product_id, unit_price || 5 "Discount", unit_price + surcharge - discount FROM products;
E. SELECT product_id, expiry_date * 2 FROM products;
F. SELECT product_id, unit_price, unit_price + surcharge FROM products;

Answer: BCF
Explanation:

B. SELECT product_id, (unit_price * 0.15 / (4.75 + 552.25)) FROM products;

C. SELECT product_id, (expiry_date - delivery_date) * 2 FROM products;

F. SELECT product_id, unit_price, unit_price + surcharge FROM products;

Question: 3 CertyIQ
What is true about non-equijoin statement performance? (Choose two.)

A. The BETWEEN condition always performs less well than using the >= and <= conditions.
B. The BETWEEN condition always performs better than using the >= and <= conditions.
C. The Oracle join syntax performs better than the SQL:1999 compliant ANSI join syntax.
D. Table aliases can improve performance.
E. The join syntax used makes no difference to performance.

Answer: DE

Explanation:

D. Table aliases can improve performance.

E. The join syntax used makes no difference to performance.

Question: 4 CertyIQ
Which two are true? (Choose two.)

A. ADD_MONTHS adds a number of calendar months to a date.


B. CEIL requires an argument which is a numeric data type.
C. CEIL returns the largest integer less than or equal to a specified number.
D. LAST_DAY returns the date of the last day of the current month only.
E. LAST_DAY returns the date of the last day of the month for the date argument passed to the function.
F. LAST_DAY returns the date of the last day of the previous month only.

Answer: AE

Explanation:

A. ADD_MONTHS adds a number of calendar months to a date.

E. LAST_DAY returns the date of the last day of the month for the date argument passed to the function.

Question: 5 CertyIQ
Which three statements are true about Oracle synonyms? (Choose three.)

A. A synonym cannot be created for a PL/SQL package.


B. A synonym can be available to all users.
C. A SEQUENCE can have a synonym.
D. Any user can drop a PUBLIC synonym.
E. A synonym created by one user can refer to an object belonging to another user.

Answer: BCE

Explanation:

B. A synonym can be available to all users.

C. A SEQUENCE can have a synonym.

E. A synonym created by one user can refer to an object belonging to another user.

Question: 6 CertyIQ
Which two are true? (Choose two.)

A. CONCAT joins two character strings together.


B. CONCAT joins two or more character strings together.
C. FLOOR returns the largest positive integer less than or equal to a specified number.
D. INSTR finds the offset within a character string, starting from position 0.
E. INSTR finds the offset within a string of a single character only.
F. FLOOR returns the largest integer less than or equal to a specified number.

Answer: AF

Explanation:

A. CONCAT joins two character strings together.

F. FLOOR returns the largest integer less than or equal to a specified number.

Question: 7 CertyIQ
Examine these SQL statements which execute successfully:
Which two statements are true after execution? (Choose two.)

A. The primary key constraint will be enabled and IMMEDIATE.


B. The foreign key constraint will be enabled and DEFERRED.
C. The primary key constraint will be enabled and DEFERRED.
D. The foreign key constraint will be disabled.
E. The foreign key constraint will be enabled and IMMEDIATE.

Answer: AD

Explanation:

A. The primary key constraint will be enabled and IMMEDIATE.

D. The foreign key constraint will be disabled.

Question: 8 CertyIQ
Examine this SQL statement:

Which two are true? (Choose two.)

A. All existing rows in the ORDERS table are updated.


B. The subquery is executed before the UPDATE statement is executed.
C. The subquery is not a correlated subquery.
D. The subquery is executed for every updated row in the ORDERS table.
E. The UPDATE statement executes successfully even if the subquery selects multiple rows.

Answer: AD

Explanation:

A. All existing rows in the ORDERS table are updated.

D. The subquery is executed for every updated row in the ORDERS table.

Question: 9 CertyIQ
Which two statements are true about TRUNCATE and DELETE? (Choose two.)

A. DELETE can use a WHERE clause to determine which row(s) should be removed.
B. TRUNCATE can use a WHERE clause to determine which row(s) should be removed.
C. TRUNCATE leaves any indexes on the table in an UNUSABLE state.
D. The result of a TRUNCATE can be undone by issuing a ROLLBACK.
E. The result of a DELETE can be undone by issuing a ROLLBACK.

Answer: AE

Explanation:

A. DELETE can use a WHERE clause to determine which row(s) should be removed. ---> Is correct

B. TRUNCATE can use a WHERE clause to determine which row(s) should be removed. ---> Its wrong bcoz
truncate will delete every rows in a table except the table definitions.

C. TRUNCATE leaves any indexes on the table in an UNUSABLE state. ----> its wrong truncate will remove
everything except table definition or skeleton of the table

D. The result of a TRUNCATE can be undone by issuing a ROLLBACK.-----> Its wrong because TRUNCATE is a
ddl statement whereas it can be done for DELETE since its dml statement

E. The result of a DELETE can be undone by issuing a ROLLBACK. ----> Its correct because DELETE is DML
statement and each delete of row are recorded in transaction log or the redo logs.

Question: 10 CertyIQ
The STORES table has a column START_DATE of data type DATE, containing the date the row was inserted.
You only want to display details of rows where START_DATE is within the last 25 months.
Which WHERE clause can be used?

A. WHERE TO_NUMBER(start_date - SYSDATE) <= 25


B. WHERE MONTHS_BETWEEN(start_date, SYSDATE) <= 25
C. WHERE MONTHS_BETWEEN(SYSDATE, start_date) <= 25
D. WHERE ADD_MONTHS(start_date, 25) <= SYSDATE
Answer: C

Explanation:

WHERE MONTHS_BETWEEN(SYSDATE, start_date) <= 25.

Question: 11 CertyIQ
You issue the following command to drop the PRODUCTS table:
SQL > DROP TABLE products;
Which three statements are true about the implication of this command? (Choose three.)

A.All data along with the table structure is deleted.


B.A pending transaction in the session is committed.
C.All indexes on the table remain but they are invalidated.
D.All views and synonyms on the table remain but they are invalidated.
E.All data in the table is deleted but the table structure remains.

Answer: ABD

Explanation:

A. All data along with the table structure is deleted.

B.A pending transaction in the session is committed.

D. All views and synonyms on the table remain but they are invalidated.

Question: 12 CertyIQ
You execute the following commands:
SQL > DEFINE hiredate = '01-APR-2011'
SQL >SELECT employee_id, first_name, salary

FROM employees -
WHERE hire_date > '&hiredate'
AND manager_id > &mgr_id;
For which substitution variables are you prompted for the input?

A.none, because no input required


B.both the substitution variables ''hiredate' and 'mgr_id'.
C.only hiredate'
D.only 'mgr_id'

Answer: D

Explanation:

Correct answer is D:only 'mgr_id'.

Question: 13 CertyIQ
View the Exhibit and examine the structure of ORDERS and ORDER_ITEMS tables. 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.

ORDER_ID -
Which DELETE statement would execute successfully?

A.DELETE orders o, order_items i WHERE o.order_id = i.order_id;


B.DELETE FROM orders WHERE (SELECT order_id FROM order_items);
C.DELETE orders WHERE order_total < 1000;
D.DELETE order_id FROM orders WHERE order_total < 1000;

Answer: C

Explanation:

DELETE orders WHERE order_total < 1000;

Question: 14 CertyIQ
View the Exhibit and examine the structure of CUSTOMERS table.
Using the CUSTOMERS table, you need to generate a report that shows an increase in the credit limit by 15% for
all customers. Customers whose credit limit has not been entered should have the message "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') "NEW CREDIT" FROM customers;

Answer: A

Explanation:

SELECT NVL (TO CHAR(cust_credit_limit * .15), 'Not Available') "NEW CREDIT" FROM customers;

Question: 15 CertyIQ
View the exhibit and examine the structures of the EMPLOYEES and DEPARTMENTS tables.
You want to update EMPLOYEES table as follows:
✑ 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 (location_id 2100).
✑ Set the employees' salary in location_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 the following command:

What is outcome?

A.It generates an error because multiple columns (SALARY, COMMISSION) cannot be specified together in an
UPDATE statement.
B.It generates an error because a subquery cannot have a join condition in a UPDATE statement.
C.It executes successfully and gives the desired update
D.It executes successfully but does not give the desired update

Answer: D

Explanation:

It executes successfully but does not give the desired update.

Question: 16 CertyIQ
Evaluate the following two queries:

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.

Answer: B

Explanation:

There would be no change in performance.

Question: 17 CertyIQ
Which is true about the ROUND, TRUNC and MOD functions?

A.TRUNC(MOD(25,3),-1) is invalid.
B.ROUND(MOD(25,3),-1) is invalid.
C.ROUND(MOD(25,3),-1) and TRUNC(MOD(25,3),-1) are both valid and give the same result.
D.ROUND(MOD(25,3),-1) and TRUNC(MOD(25,3),-1) are both valid but give different results.

Answer: C

Explanation:

ROUND(MOD(25,3),-1) and TRUNC(MOD(25,3),-1) are both valid and give the same result.
Question: 18 CertyIQ
View the Exhibit and examine the details of PRODUCT_INFORMATION table.

You have the requirement to display PRODUCT_NAME from the table where the CATEGORY_ID column has values
12 or 13, and the SUPPLIER_ID column has the value 102088. You executed the following SQL statement:

SELECT product_name -

FROM product_information -
WHERE (category_id = 12 AND category_id = 13) AND supplier_id = 102088;
Which statement is true regarding the execution of the query?

A.It would not execute because the same column has been used in both sides of the AND logical operator to
form the condition.
B.It would not execute because the entire WHERE clause condition is not enclosed within the parentheses.
C.It would execute and the output would display the desired result.
D.It would execute but the output would return no rows.

Answer: D

Explanation:

It would execute but the output would return no rows.


Question: 19 CertyIQ
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.

Answer: AC

Explanation:

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.

References:

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

Question: 20 CertyIQ
View the exhibit and examine the structure of the STORES table.

You must display the NAME of stores 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/100 FROM stores WHERE 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/100 FROM stores WHERE 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/100 FROM stores WHERE 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/100 FROM stores WHERE MONTHS_BETWEEN (start_date, TO_DATE('01-JAN-2000','DD-
MON-RRRR')) <=36;

Answer: C

Explanation:

SELECT name, address||', '||city||', '||country AS full_address, start_date, property_price,


property_price*115/100 FROM stores WHERE MONTHS_BETWEEN(start_date,TO_DATE('01-JAN-2000','DD-
MON-RRRR')) <=36;.

Question: 21 CertyIQ
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.

Answer: D

Explanation:

D is correct. Works as long as there is a 3 column in the select list. If the number of columns in the table is 2
then the query would not execute. You'd get something like ORA-01785.Ascending is the default ORDER BY.

Question: 22 CertyIQ
Which two are true about the precedence of operators and conditions? (Choose two.)

A.|| has a higher order of precedence than + (addition).


B.+ (addition) has a higher order of precedence than * (multiplication).
C.NOT has a higher order of precedence than AND and OR in a condition.
D.AND and OR have the same order of precedence in a condition.
E.Operators are evaluated before conditions.

Answer: CE

Explanation:

C.NOT has a higher order of precedence than AND and OR in a condition.

E. Operators are evaluated before conditions.

Reference:

https://docs.oracle.com/cd/E49933_01/server.770/es_eql/src/ceql_expr_precedence_rules.html#:~:text=
The%20rules%20are,the%20JOIN%20operators.

Question: 23 CertyIQ
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 of the managers and the second column would have LAST_NAME of the
employees.

LAST_NAME -
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

Explanation:

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;

Question: 24 CertyIQ
Which three statements are true about multiple-row subqueries?

A.They can contain a subquery within a subquery.


B.They can return multiple columns as well as rows.
C.They cannot contain a subquery within a subquery.
D.They can return only one column but multiple rows.
E.They can contain group functions and GROUP BY and HAVING clauses.
F.They can contain group functions and the GROUP BY clause, but not the HAVING clause.

Answer: ABE

Explanation:

A. They can contain a subquery within a subquery.

B. They can return multiple columns as well as rows.

E. They can contain group functions and GROUP BY and HAVING clauses.

Question: 25 CertyIQ
Examine the structure of the EMPLOYEES table.

There is a parent/child relationship between EMPLOYEE_ID and MANAGER_ID.


You want to display the last names and manager IDs of employees who work for the same manager as the
employee whose EMPLOYEE_ID is 123.
Which query provides the correct output?

A.SELECT e.last_name, m.manager_id FROM employees e RIGHT OUTER JOIN employees m on (e.manager_id =
m.employee_id) AND e.employee_id = 123;
B.SELECT e.last_name, m.manager_id FROM employees e LEFT OUTER JOIN employees m on (e.employee_id =
m.manager_id) WHERE e.employee_id = 123;
C.SELECT e.last_name, e.manager_id FROM employees e RIGHT OUTER JOIN employees m on (e.employee_id =
m.employee_id) WHERE e.employee_id = 123;
D.SELECT m.last_name, e.manager_id FROM employees e LEFT OUTER JOIN employees m on (e.manager_id =
m.manager_id) WHERE e.employee_id = 123;

Answer: D

Explanation:

SELECT m.last_name, e.manager_id FROM employees e LEFT OUTER JOIN employees m on (e.manager_id =
m.manager_id) WHERE e.employee_id = 123;
Question: 26 CertyIQ
Which normal form is a table in if it has no multi-valued attributes and no partial dependencies?

A.second normal form


B.first normal form
C.third normal form
D.fourth normal form

Answer: A

Explanation:

References:

https://blog.udemy.com/database-normal-forms/

Question: 27 CertyIQ
Sales data of a company is stored in two tables, SALES1 and SALES2, with some data being duplicated across the
tables. You want to display the results from the table, which are not present in the SALES2 table.

SALES1 -

Which set operator generates the required output?


A.INTERSECT
B.UNION
C.PLUS
D.MINUS
E.SUBTRACT

Answer: D

Explanation:

Correct answer is D:SUBTRACT.

References:

https://docs.oracle.com/cd/B19306_01/server.102/b14200/queries004.htm

Question: 28 CertyIQ
Which two statements are true about conditional INSERT ALL? (Choose two.)

A.Each row returned by the subquery can be inserted into only a single target table.
B.A single WHEN condition can be used for multiple INTO clauses.
C.Each WHEN condition is tested for each row returned by the subquery.
D.It cannot have an ELSE clause.
E.The total number of rows inserted is always equal to the number of rows returned by the subquery.

Answer: BC

Explanation:

B.A single WHEN condition can be used for multiple INTO clauses.

C. Each WHEN condition is tested for each row returned by the subquery.

Reference:

https://oracle-base.com/articles/9i/multitable-inserts

Question: 29 CertyIQ
Evaluate the following SQL statements that are issued in the given order:

CREATE TABLE emp -


(emp_no NUMBER(2) CONSTRAINT emp_emp_no_pk PRIMARY KEY,
ename VARCHAR2(15),
salary NUMBER (8,2),
mgr_no NUMBER(2) CONSTRAINT emp_mgr_fk REFERENCES emp(emp_no));

ALTER TABLE emp -


DISABLE CONSTRAINT emp_emp_no_pk CASCADE;

ALTER TABLE emp -


ENABLE CONSTRAINT emp_emp_no_pk;
What would be the status of the foreign key EMP_MGR_PK?
A.It would remain disabled and can be enabled only by dropping the foreign key constraint and recreating it.
B.It would remain disabled and has to be enabled manually using the ALTER TABLE command.
C.It would be automatically enabled and immediate.
D.It would be automatically enabled and deferred.

Answer: B

Explanation:

It would remain disabled and has to be enabled manually using the ALTER TABLE command.

Question: 30 CertyIQ
Which three statements are true regarding the data types? (Choose three.)

A.The minimum column width that can be specified for a VARCHAR2 data type column is one.
B.Only one LONG column can be used per table.
C.A TIMESTAMP data type column stores only time values with fractional seconds.
D.The BLOB data type column is used to store binary data in an operating system file.
E.The value for a CHAR data type column is blank-padded to the maximum defined column width.

Answer: ABE

Explanation:

A. The minimum column width that can be specified for a VARCHAR2 data type column is one.

B. Only one LONG column can be used per table.

E. The value for a CHAR data type column is blank-padded to the maximum defined column width.

ABE are correctC is incorrect because, although a TIMESTAMP can store values with up to a precision of 9 (a
nanosecond) it is not mandatory. D in incorrect because although a BLOB does store binary data, it does so
within the database, a BFILE stores information in an OS file.

Question: 31 CertyIQ
Which three statements are true regarding subqueries? (Choose three.)

A.Multiple columns or expressions can be compared between the main query and subquery.
B.Subqueries can contain ORDER BY but not the GROUP BY clause.
C.Main query and subquery can get data from different tables.
D.Subqueries can contain GROUP BY and ORDER BY clauses.
E.Main query and subquery must get data from the same tables.
F.Only one column or expression can be compared between the main query and subquery.

Answer: ACD

Explanation:

A. Multiple columns or expressions can be compared between the main query and subquery.
C.Main query and subquery can get data from different tables.

D. Subqueries can contain GROUP BY and ORDER BY clauses.

References:

http://docs.oracle.com/javadb/10.6.2.1/ref/rrefsqlj13658.html

Question: 32 CertyIQ
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:

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

Question: 33 CertyIQ
Examine the structure of the MEMBERS table.

Which query can be used to display the last names and city names only for members from the states MO and MI?

A.SELECT last_name, city FROM members WHERE state ='MO' AND state ='MI';
B.SELECT last_name, city FROM members WHERE state LIKE 'M%';
C.SELECT last_name, city FROM members WHERE state IN ('MO', 'MI');
D.SELECT DISTINCT last_name, city FROM members WHERE state ='MO' OR state ='MI';

Answer: C

Explanation:

A. SELECT last_name, city FROM members WHERE state ='MO' AND state ='MI';should be OR, not ANDB.
SELECT last_name, city FROM members WHERE state LIKE 'M%';this gets Montana as well (MT)C. SELECT
last_name, city FROM members WHERE state IN ('MO', 'MI');CorrectD. SELECT DISTINCT last_name, city
FROM members WHERE state ='MO' OR state ='MI';loses duplicates.
Question: 34 CertyIQ
Which statement is true about an inner join specified in a query's WHERE clause?

A.It only applies for equijoin conditions.


B.It applies for equijoin and nonequijoin conditions.
C.It requires column names to be the same in all tables being joined.
D.It must have primary-key and foreign-key constraints defined on the join columns.

Answer: B

Explanation:

Equijoin example:

SELECT a.agent_name, c.cust_name, c.cust_city

FROM agents a, customer c

WHERE a.working_area=c.cust_city;

Nonequijoin example:

SELECT a.ord_num, a.ord_amount, b.cust_name, b.working_area

FROM orders a, customer b

WHERE a.ord_amount BETWEEN b.opening_amt AND b.opening_amt;

Question: 35 CertyIQ
Which task can be performed by using a single Data Manipulation Language (DML) statement?

A.adding a column constraint while inserting a row into a table


B.adding a column with a default value while inserting a row into a table
C.removing all data only from a single column on which a unique constraint is defined
D.removing all data only from a single column on which a primary key constraint is defined

Answer: C

Explanation:

C is correct. The UNIQUE constraint does not treat NULLS as duplicative if more than one NULL exists on the
UNIQUE column. In other words, even with the UNIQUE constraint on a column, you can insert, update that
column to NULL on multiple rows without issues.

Question: 36 CertyIQ
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?

A.SELECT member_id AS MEMBER_ID, due_date AS DUE_DATE, $2 AS LATE_FEE FROM


BOOKS_TRANSACTIONS;
B.SELECT member_id 'MEMBER ID', due_date 'DUE DATE', '$2 AS LATE FEE' FROM BOOKS_TRANSACTIONS;
C.SELECT member_id AS "MEMBER ID", due_date AS "DUE DATE", '$2' AS "LATE FEE" FROM
BOOKS_TRANSACTIONS;
D.SELECT member_id AS "MEMBER ID", due_date AS "DUE DATE", $2 AS "LATE FEE" FROM
BOOKS_TRANSACTIONS;

Answer: C

Explanation:

C is correctA column alias can not have spaces unless it is wrapped in double quotes.string literals have to be
wrapped in single quotes. so '$2' not $2 (which would be a number)lastly the AS clause is optional when
naming a column alias.

Question: 37 CertyIQ
In which three situations does a transaction complete?

A.when a PL/SQL anonymous block is executed


B.when a DELETE statement is executed
C.when a ROLLBACK command is executed
D.when a data definition language (DDL) statement is executed
E.when a TRUNCATE statement is executed after the pending transaction

Answer: CDE

Explanation:

A transaction ends when:- A user issues a COMMIT or ROLLBACK statement without a SAVEPOINT clause.- A
user runs a DDL command such as CREATE, DROP, RENAME, or ALTER.- A user exits normally from most
Oracle Database utilities and tools, causing the current transaction to be implicitly committed. The commit
behavior when a user disconnects is application-dependent and configurable.A DELETE sentence and an
anonymous plsql block aren´t a DDL operation or a commit/rollback.T hen the right answers are the three DDL
sentences CDE.

References:

https://docs.oracle.com/cd/B19306_01/server.102/b14220/transact.htm
Question: 38 CertyIQ
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?

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


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

Answer: B

Explanation:

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

References:

https://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9016.htm
Question: 39 CertyIQ
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.Remove the single quotation marks enclosing the character literal string in the SELECT clause
B.Use the escape character to negate the single quotation mark within the literal character string in the
SELECT clause
C.Enclose the character literal string in the SELECT clause within double quotation marks
D.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: B

Explanation:

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

Question: 40 CertyIQ
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 MODIFY CONSTRAINT orders_cust_id_nn NOT NULL (customer_id);


B.ALTER TABLE orders ADD CONSTRAINT orders_cust_id_nn NOT NULL (customer_id);
C.ALTER TABLE orders MODIFY customer_id CONSTRAINT orders_cust_nn NOT NULL (customer_id);
D.ALTER TABLE orders ADD customer_id NUMBER(6)CONSTRAINT orders_cust_id_nn NOT NULL;

Answer: C

Explanation:

ALTER TABLE orders MODIFY customer_id CONSTRAINT orders_cust_nn NOT NULL (customer_id);
Question: 41 CertyIQ
Examine the structure of the INVOICE table.

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;

Answer: AC

Explanation:

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

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

Question: 42 CertyIQ
Which three statements are true about the ALTER TABLE....DROP COLUMN.... command?

A.A column can be dropped only if it does not contain any data.
B.A column can be dropped only if another column exists in the table.
C.A dropped column can be rolled back.
D.The column in a composite PRIMARY KEY with the CASCADE option can be dropped.
E.A parent key column in the table cannot be dropped.

Answer: BDE

Explanation:

A parent column CAN be dropped:CREATE TABLE parents(parent_id NUMBER(3) PRIMARY KEY,value2


NUMBER(3));CREATE TABLE childs(parent_id NUMBER(3) REFERENCES parents(parent_id),value2
NUMBER(3));INSERT INTO parents VALUES(10, -999);INSERT INTO childs VALUES(10, -888);ALTER TABLE
parentsDROP (parent_id) CASCADE CONSTRAINTS; B D E are "correct".

Question: 43 CertyIQ
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?

A.SELECT COUNT (DISTINCT list_price) FROM product_information WHERE list_price is NULL


B.SELECT COUNT (NVL(list_price, 0)) FROM product_information WHERE list_price is NULL
C.SELECT COUNT (list_price) FROM product_information WHERE list_price i= NULL
D.SELECT COUNT (list_price) FROM product_information WHERE list_price is NULL

Answer: B

Explanation:

SELECT COUNT (NVL(list_price, 0)) FROM product_information WHERE list_price is NULL.

only COUNT(*) includes NULL values. NVL(list, 0) says if list is NULL, return 0. This way it is included in the
count.

Question: 44 CertyIQ
Which three tasks can be performed using SQL functions built into Oracle Database?

A.displaying a date in a nondefault format


B.finding the number of characters in an expression
C.substituting a character string in a text expression with a specified string
D.combining more than two columns or expressions into a single column in the output

Answer: ABC

Explanation:

A.displaying a date in a nondefault format.

B.finding the number of characters in an expression.


C.substituting a character string in a text expression with a specified string.

Question: 45 CertyIQ
The user SCOTT who is the owner of ORDERS and ORDER_ITEMS tables issues this GRANT command:

GRANT ALL -

ON orders, order_items -
TO PUBLIC;
What must be done to fix the statement?

A.PUBLIC should be replaced with specific usernames.


B.ALL should be replaced with a list of specific privileges.
C.WITH GRANT OPTION should be added to the statement.
D.Separate GRANT statements are required for the ORDERS and ORDER_ITEMS tables.

Answer: D

Explanation:

Separate GRANT statements are required for the ORDERS and ORDER_ITEMS tables.

References:

http://docs.oracle.com/javadb/10.8.3.0/ref/rrefsqljgrant.html

Question: 46 CertyIQ
You are designing the structure of a table in which two columns have the specifications:
"" must be able to contain a maximum of 12 alphanumeric characters and must uniquely identify the row

COMPONENT_ID -
"" contains Century, Year, Month, Day, Hour, Minute, Second to the maximum precision and is used for calculations
and comparisons

EXECUTION_DATETIME -
between components.
Which two options define the data types that satisfy these requirements most efficiently? (Choose two.)

A.The EXECUTION_DATETIME must be of INTERVAL DAY TO SECOND data type.


B.The EXECUTION_DATETIME must be of TIMESTAMP data type.
C.The EXECUTION_DATETIME must be of DATE data type.
D.The COMPONENT_ID must be of ROWID data type.
E.The COMPONENT_ID must be of VARCHAR2 data type.
F.The COMPONENT_ID column must be of CHAR data type.

Answer: BE

Explanation:

B. The EXECUTION_DATETIME must be of TIMESTAMP data type.

E. The COMPONENT_ID must be of VARCHAR2 data type.


Question: 47 CertyIQ
You want to display the date for the first Monday of the next month and issue the following command:

What is the outcome?

A.In generates an error because rrrr should be replaced by rr in the format string.
B.It executes successfully but does not return the correct result.
C.It executes successfully and returns the correct result.
D.In generates an error because TO_CHAR should be replaced with TO_DATE.
E.In generates an error because fm and double quotation marks should not be used in the format string.

Answer: C

Explanation:

It executes successfully and returns the correct result.

Question: 48 CertyIQ
Which two statements are true regarding the GROUP BY clause in a SQL statement? (Choose two.)

A.You can use column alias in the GROUP BY clause.


B.Using the WHERE clause after the GROUP BY clause excludes the rows after creating groups.
C.The GROUP BY clause is mandatory if you are using an aggregate function in the SELECT clause.
D.Using the WHERE clause before the GROUP BY clause excludes the rows before creating groups.
E.If the SELECT clause has an aggregate function, then those individual columns without an aggregate function
in the SELECT clause should be included in the GROUP BY

Answer: DE

Explanation:

D.Using the WHERE clause before the GROUP BY clause excludes the rows before creating groups.

E.If the SELECT clause has an aggregate function, then those individual columns without an aggregate
function in the SELECT clause should be included in the GROUP BY.

Question: 49 CertyIQ
Examine the description of the EMPLOYEES table:
For each employee in department 90 you want to display:
1. their last name
2. the number of complete weeks they have been employed
The output must be sorted by the number of weeks, starting with the longest serving employee first.
Which statement will accomplish this?
A.

B.

C.

D.

Answer: B

Explanation:

B , trunc retunr the number of complete weeks they have been employed.

B. Rounding up gives then employees extra days for their "complete" weeks.

Question: 50 CertyIQ
Examine the description of the PRODUCT_DETAILS table:
Which two statements are true? (Choose two.)

A.EXPIRY_DATE contains the SYSDATE by default if no date is assigned to it.


B.PRODUCT_PRICE can be used in an arithmetic expression even if it has no value stored in it.
C.PRODUCT_NAME cannot contain duplicate values.
D.EXPIRY_DATE cannot be used in arithmetic expressions.
E.PRODUCT_PRICE contains the value zero by default if no value is assigned to it.
F.PRODUCT_ID can be assigned the PRIMARY KEY constraint.

Answer: BF

Explanation:

B.PRODUCT_PRICE can be used in an arithmetic expression even if it has no value stored in it.

F.PRODUCT_ID can be assigned the PRIMARY KEY constraint.

Question: 51 CertyIQ
View the exhibit for the structure of the STUDENT and FACULTY tables.

You need to display the faculty name followed by the number of students handled by the faculty at the base
location.
Examine the following two SQL statements:

Statement 1 -
SQL>SELECT faculty_name, COUNT(student_id)

FROM student JOIN faculty -


USING (faculty_id, location_id)
GROUP BY faculty_name;

Statement 2 -
SQL>SELECT faculty_name, COUNT(student_id)
FROM student NATURAL JOIN faculty
GROUP BY faculty_name;
Which statement is true regarding the outcome?

A.Only statement 2 executes successfully and gives the required result.


B.Only statement 1 executes successfully and gives the required result.
C.Both statements 1 and 2 execute successfully and give different results.
D.Both statements 1 and 2 execute successfully and give the same required result.

Answer: D

Explanation:

D is the correct answer:

create table students

( col number(2));

create table locat

(col varchar2(2));

insert into students values(1);

insert into locat values('1');

select col from students s natural join locat l;

select col from students s join locat l using(col);

Question: 52 CertyIQ
Which statement correctly grants a system privilege?

A.GRANT CREATE VIEW ON table1 TO user1;


B.GRANT ALTER TABLE TO PUBLIC;
C.GRANT CREATE TABLE TO user1, user2;
D.GRANT CREATE SESSION TO ALL;

Answer: C

Explanation:

Answer is C

You CAN grant a privilege to two (or even more) users.

Reference:

https://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9013.htm#i2062318
Question: 53 CertyIQ
Which two statements are true regarding indexes? (Choose two.)

A.An update to a table can result in updates to any or all of the table's indexes.
B.An update to a table can result in no updates to any of the table's indexes.
C.A UNIQUE index can be altered to be non-unique.
D.When a table is dropped and is moved to the RECYCLE BIN, all indexes built on that table are permanently
dropped.
E.A table belonging to one user cannot have an index that belongs to a different user.

Answer: AB

Explanation:

A.An update to a table can result in updates to any or all of the table's indexes.

B.An update to a table can result in no updates to any of the table's indexes.

Question: 54 CertyIQ
Which two are true about queries using set operators (UNION, UNION ALL, INTERSECT and MINUS)? (Choose two.)

A.The name of each column in the first SELECT list must match the name of the corresponding column in each
subsequent SELECT list.
B.None of the set operators can be used when selecting CLOB columns.
C.There must be an equal number of columns in each SELECT list.
D.Each SELECT statement in the query can have an ORDER BY clause.
E.The FOR UPDATE clause cannot be specified.

Answer: BE

Explanation:

B. None of the set operators can be used when selecting CLOB columns.

E. The FOR UPDATE clause cannot be specified.

Question: 55 CertyIQ
View the exhibit and examine the description of the DEPARTMENTS and EMPLOYEES tables.
You wrote this SQL statement to retrieve EMPLOYEE_ID, FIRST_NAME, and DEPARTMENT NAME, for all
employees:
SELECT employee_id, first_name, department_name

FROM employees -
NATURAL JOIN departments;
The desired output is not obtained after executing the above SQL statement. What could be the reason for this?

A.The table prefix is missing for the column names in the SELECT clause.
B.The NATURAL JOIN clause is missing the USING clause.
C.The DEPARTMENTS table is not used before the EMPLOYEES table in the FROM clause.
D.The EMPLOYEES and DEPARTMENTS tables have more than one column with the same column name and
data type.

Answer: D

Explanation:
Natural join needs only one column to be the same in each table. The EMPLOYEES and DEPARTMENTS tables
have two columns that are the same
(Department_ID and Manager_ID)

Question: 56 CertyIQ
Which two statements are true about sequences created in a single instance Oracle database? (Choose two.)

A.When the MAXVALUE limit for a sequence is reached, it can be increased by using the ALTER SEQUENCE
statement. > would remove a sequence from the database.
C.The numbers generated by an explicitly defined sequence can only be used to insert data in one table.
D.CURRVAL is used to refer to the most recent sequence number that has been generated for a particular
sequence.
E.When a database instance shuts down abnormally, sequence numbers that have been cached but not used
are available again when the instance is restarted.

Answer: AD

Explanation:

A. When the MAXVALUE limit for a sequence is reached, it can be increased by using the ALTER SEQUENCE
statement. [correct]B. DELETE <sequence_ name> would remove a sequence from the database. [Incorrect:
DROP <sequence_name>would remove a sequence from the database. ]C. The numbers generated by an
explicitly defined sequence can only be used to insert data in one table.[incorrect: The same sequence can be
used to insert data into multiple tables or views. ]D. CURRVAL is used to refer to the most recent sequence
number that has been generated for a particular sequence. [correct]E. When a database instance shuts down
abnormally, sequence numbers that have been cached but not used are available again when the instance is
restarted. [incorrect: Even the sequence wasn't used, the sequence number will get incremented in such
scenario.

References:

http://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_2012.htm#SQLRF00817
https://docs.oracle.com/cd/A84870_01/doc/server.816/a76989/ch26.htm

Question: 57 CertyIQ
View the exhibit and examine the structure of the CUSTOMERS table.

Which two tasks would require subqueries or joins to be executed in a single statement?

A.finding the number of customers, in each city, whose credit limit is more than the average credit limit of all
the customers
B.finding the average credit limit of male customers residing in 'Tokyo' or 'Sydney'
C.listing of customers who do not have a credit limit and were born before 1980
D.finding the number of customers, in each city, whose marital status is 'married'.
E.listing of those customers, whose credit limit is the same as the credit limit of customers residing in the city
'Tokyo'.

Answer: AE

Explanation:

A.finding the number of customers, in each city, whose credit limit is more than the average credit limit of all
the customers.

E.listing of those customers, whose credit limit is the same as the credit limit of customers residing in the city
'Tokyo'.

Question: 58 CertyIQ
Which two statements are true about selecting related rows from two tables based on an Entity Relationship
Diagram (ERD)? (Choose two.)

A.Rows from unrelated tables cannot be joined.


B.Relating data from a table with data from the same table is implemented with a self join.
C.Implementing a relationship between two tables might require joining additional tables.
D.Every relationship between the two tables must be implemented in a join condition.
E.An inner join relates rows within the same table.

Answer: BC

Explanation:

B.Relating data from a table with data from the same table is implemented with a self join.

C.Implementing a relationship between two tables might require joining additional tables.

Question: 59 CertyIQ
View the exhibit and examine the structure in ORDERS and ORDER_ITEMS tables.

You need to create a view that displays the ORDER_ID, ORDER_DATE, and the total number of items in each order.
Which CREATE VIEW statement would create the view successfully?
A.CREATE OR REPLACE VIEW ord_vu AS SELECT o.order_id, o.order_date, COUNT (i.line_item_id) FROM orders
o JOIN order_items i ON (o.order_id = i.order_id) GROUP BY o.order_id, o.order_date;
B.CREATE OR REPLACE VIEW ord_vu (order_id, order_date) AS SELECT o.order_id, o.order_date, COUNT
(i.line_item_id) "NO OF ITEMS" FROM orders o JOIN order_items i ON (o.order_id = i.order_id) GROUP BY
o.order_id, o.order_date;
C.CREATE OR REPLACE VIEW ord_vu AS SELECT o.order_id, o.order_date, COUNT (i.line_item_id) "NO OF
ITEMS" FROM orders o JOIN order_items i ON (o.order_id = i.order_id) GROUP BY o.order_id, o.order_date;
D.CREATE OR REPLACE VIEW ord_vu AS SELECT o.order_id, o.order_date, COUNT (i.line_item_id) || "NO OF
ITEMS" FROM orders o JOIN order_items i ON (o.order_id = i.order_id) GROUP BY o.order_id, o.order_date
WHITH CHECK OPTION;

Answer: C

Explanation:

C.CREATE OR REPLACE VIEW ord_vu AS SELECT o.order_id, o.order_date, COUNT (i.line_item_id) "NO OF
ITEMS" FROM orders o JOIN order_items i ON (o.order_id = i.order_id) GROUP BY o.order_id, o.order_date;

Question: 60 CertyIQ
Which statement is true about an inner join specified in the WHERE clause of a query?

A.It must have primary-key and foreign-key constraints defined on the columns used in the join condition.
B.It requires the column names to be the same in all tables used for the join conditions.
C.It is applicable for equijoin and nonequijoin conditions.
D.It is applicable for only equijoin conditions.

Answer: C

Explanation:

The correct Answer is C :EQUI JOIN creates a JOIN for equality or matching column(s) values of the relative
tables. Example:SELECT student.name, student.id, record.class, record.cityFROM student, recordWHERE
student.city = record.city;The join is replaced by the comma '' FROM student, record ''NON EQUI JOIN
performs a JOIN using comparison operator other than equal(=) sign like >, <, >=, <= with conditions.Example
:SELECT student.name, record.id, record.cityFROM student, recordWHERE Student.id < Record.id ;We can
remplace "<" by another sign like >, <, >=, <= I hope it's clear.

Question: 61 CertyIQ
Which three statements are true about inner and outer joins? (Choose three.)

A.A full outer join returns matched and unmatched rows.


B.Outer joins can be used when there are multiple join conditions on two tables.
C.A full outer join must use Oracle syntax.
D.Outer joins can only be used between two tables per query.
E.A left or right outer join returns only unmatched rows.
F.An inner join returns matched rows.

Answer: ABF
Explanation:

A. Option A is true. A full outer join returns both matched rows and unmatched rows from the joined tables.
Matched rows are those that satisfy the join condition, while unmatched rows are those that do not have a
matching row in the other table.

B. Option B is true. Outer joins can be used when there are multiple join conditions on two tables. This allows
for more complex join conditions and provides flexibility in joining tables based on multiple criteria.

F. Option F is true. An inner join returns only the matched rows from the joined tables. It filters out the
unmatched rows, resulting in a result set that contains only the rows that satisfy the join condition.

Question: 62 CertyIQ
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.

Answer: C

Explanation:

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

References:

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

Question: 63 CertyIQ
The first DROP operation is performed on PRODUCTS table using this command:
DROP TABLE products PURGE;
Then a FLASHBACK operation is performed using this command:
FLASHBACK TABLE products TO BEFORE DROP;
Which is true about the result 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

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

References:

https://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_9003.htm

Question: 64 CertyIQ
These are the steps for a correlated subquery, listed in random order:
1. The WHERE clause of the outer query is evaluated.
2. A candidate row is fetched from the table specified in the outer query.
3. This is repeated for the subsequent rows of the table, until 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.
Which is the correct sequence in which the Oracle server evaluates a correlated subquery?

A.2, 1, 4, 3
B.4, 1, 2, 3
C.4, 2, 1, 3
D.2, 4, 1, 3

Answer: D

Explanation:

D is correct.Remember this is for a correlated subquery. Each outer query row provides input to run the
correlated subquery. The correlated subquery's result may be needed to evaluate the where clause.

References:

http://rajanimohanty.blogspot.co.uk/2014/01/correlated-subquery.html

Question: 65 CertyIQ
Evaluate the following query:
SQL> SELECT TRUNC (ROUND(156.00, -1),-1)
FROM DUAL;
What would be the outcome?

A.150
B.200
C.160
D.16
E.100

Answer: C

Explanation:

Correct answer is 160. Order of operations the round is done first if you round using a -1 it takes the number to
the nearest 10's so 156.00 becomes 160.

References:
https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions135.htm
https://docs.oracle.com/cd/B28359_01/olap.111/b28126/dml_functions_2127.htm

Question: 66 CertyIQ
Examine this statement:

What is returned upon execution?

A.an error
B.2 rows
C.0 rows
D.1 row

Answer: D

Explanation:

Correct answer is D:1 row.

Question: 67 CertyIQ
View the exhibit and examine the structure of the SALES, CUSTOMERS, PRODUCTS and TIMES tables.
The PROD_ID column is the foreign key in the SALES table, which references the PRODUCTS table.
Similarly, the CUST_ID and TIME_ID columns are also foreign keys in the SALES table referencing the
CUSTOMERS and TIMES tables, respectively.
Evaluate the following CREATE TABLE command:
CREATE TABLE new_sales (prod_id, cust_id, order_date DEFAULT SYSDATE)

AS -
SELECT prod_id, cust_id, time_id
FROM sales;
Which statement is true regarding the above command?

A.The NEW_SALES table would get created and all the NOT NULL constraints defined on the specified columns
would be passed to the new table.
B.The NEW_SALES table would not get created because the DEFAULT value cannot be specified in the column
definition.
C.The NEW_SALES table would not get created because the column names in the CREATE TABLE command
and the SELECT clause do not match.
D.The NEW_SALES table would get created and all the FOREIGN KEY constraints defined on the specified
columns would be passed to the new table.

Answer: A

Explanation:

The NEW_SALES table would get created and all the NOT NULL constraints defined on the specified columns
would be passed to the new table.
Question: 68 CertyIQ
Which two statements are true regarding the USING and ON clauses in table joins?

A.Both USING and ON clauses can be used for equijoins and nonequijoins.
B.A maximum of one pair of columns can be joined between two tables using the ON clause.
C.The ON clause can be used to join tables on columns that have different names but compatible data types.
D.The WHERE clause can be used to apply additional conditions in SELECT statements containing the ON or the
USING clause.

Answer: CD

Explanation:

C.The ON clause can be used to join tables on columns that have different names but compatible data types.

D.The WHERE clause can be used to apply additional conditions in SELECT statements containing the ON or
the USING clause.

Question: 69 CertyIQ
An Oracle Database session has an uncommitted transaction in progress which updated 5000 rows in a table.
In which three situations does the transaction complete thereby committing the updates? (Choose three.)

A.when a CREATE TABLE AS SELECT statement is issued in the same session but fails with a syntax error
B.when a DBA issues a successful SHUTDOWN TRANSACTIONAL statement and the user then issues a
COMMIT
C.when the session logs out successfully
D.when a CREATE INDEX statement is executed successfully in the same session
E.when a DBA issues a successful SHUTDOWN IMMEDIATE statement and the user then issues a COMMIT
F.when a COMMIT statement is issued by the same user from another session in the same database instance

Answer: BCD

Explanation:

B .when a DBA issues a successful SHUTDOWN TRANSACTIONAL statement and the user then issues a
COMMIT.

C. when the session logs out successfully.

D .when a CREATE INDEX statement is executed successfully in the same session.

Question: 70 CertyIQ
Which three statements are true? (Choose three.)

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


B.The data dictionary views consist of joins of dictionary base tables and user-defined tables.
C.The usernames of all the users including database administrators are stored in the data dictionary.
D.The USER_CONS_COLUMNS view should be queried to find the names of columns to which constraints apply.
E.Both USER_OBJECTS and CAT views provide the same information about all objects that are owned by the
user.
F.Views with the same name but different prefixes, such as DBA, ALL and USER, reference the same base
tables from the data dictionary.

Answer: CDF

Explanation:

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

D. The USER_CONS_COLUMNS view should be queried to find the names of columns to which constraints
apply.

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

References:

https://docs.oracle.com/cd/B10501_01/server.920/a96524/c05dicti.htm

Question: 71 CertyIQ
View the exhibits and examine the structures of the COSTS and PROMOTIONS tables.
Evaluate the following SQL statement:

What would be the outcome of the above SQL statement?

A.It displays prod IDs in the promo with the lowest cost.
B.It displays prod IDs in the promos with the lowest cost in the same time interval.
C.It displays prod IDs in the promos with the highest cost in the same time interval.
D.It displays prod IDs in the promos which cost less than the highest cost in the same time interval.

Answer: D

Explanation:

It displays prod IDs in the promos which cost less than the highest cost in the same time interval.

Question: 72 CertyIQ
View the exhibit and examine the descriptions of the DEPT and LOCATIONS 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 = ALL (SELECT city FROM locations l WHERE d.location_id = l.location_id);
B.UPDATE dept d SET city = (SELECT city FROM locations l) WHERE d.location_id = l.location_id;
C.UPDATE dept d SET city = ANY (SELECT city FROM locations l)
D.UPDATE dept d SET city = (SELECT city FROM locations l WHERE d.location_id = l.location_id);

Answer: D

Explanation:

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

Question: 73 CertyIQ
The BOOKS_TRANSACTIONS table exists in your schema in this database.
You execute this SQL statement when connected to your schema in your database instance.
SQL> SELECT * FROM books_transactions ORDER BY 3;
What is the result?

A.The execution fails unless the numeral 3 in the ORDER BY clause is replaced by a column name.
B.All table rows are displayed sorted in ascending order of the values in the third column.
C.The first three rows in the table are displayed in the order that they are stored.
D.Only the three rows with the lowest values in the key column are displayed in the order that they are stored.

Answer: B

Explanation:

All table rows are displayed sorted in ascending order of the values in the third column.
Question: 74 CertyIQ
Examine the description of the BRICKS table:

Examine the description of the BRICKS_STAGE table:

Which two queries execute successfully? (Choose two.)


A.

B.

C.

D.

E.

Answer: AD
Explanation:

AD is Correct answer.Use Minus operator to return all distinct rows selected by the first query, but not
present in the second query result set. In Minus operator, the number of columns must be the same and data
type of columns being selected by the SELECT statements in queries must belong to the same data type
group in all the SELECT statements used in the query. The names of the columns, however, need not be
identical.

Question: 75 CertyIQ
Table EMPLOYEES contains columns including EMPLOYEE_ID, JOB_ID and SALARY.
Only the EMPLOYEE_ID column is indexed.
Rows exist for employees 100 and 200.
Examine this statement:

Which two statements are true? (Choose two.)

A.Employees 100 and 200 will have the same SALARY as before the update command.
B.Employee 100 will have JOB_ID set to the same value as the JOB_ID of employee 200.
C.Employee 200 will have JOB_ID set to the same value as the JOB_ID of employee 100.
D.Employees 100 and 200 will have the same JOB_ID as before the update command.
E.Employee 100 will have SALARY set to the same value as the SALARY of employee 200.
F.Employee 200 will have SALARY set to the same value as the SALARY of employee 100.

Answer: BE

Explanation:

B. Employee 100 will have JOB_ID set to the same value as the JOB_ID of employee 200.

E. Employee 100 will have SALARY set to the same value as the SALARY of employee 200.

Question: 76 CertyIQ
View the Exhibit and examine the structure of the ORDER_ITEMS table.
Examine the following SQL statement:
SELECT order_id, product_id, unit_price

FROM order_items -
WHERE unit_price =
(SELECT MAX(unit_price)

FROM order_items -
GROUP BY order_id);
You want to display the PRODUCT_ID of the product that has the highest UNIT_PRICE per ORDER_ID. What
correction should be made in the above SQL statement to achieve this?

A.Remove the GROUP BY clause from the subquery and place it in the main query
B.Replace = with the >ANY operator
C.Replace = with the >ALL operator
D.Replace = with the IN operator

Answer: D

Explanation:

Answer is D. The query with '=' will fail because the sub-query is returning more than one row. Therefore all
you need to do is replace '=' with 'IN' and the query will execute successfully and return the desired results.

Question: 77 CertyIQ
You want to return the current date and time from the user session, with a data type of TIMESTAMP WITH TIME
ZONE.
Which function will do this?

A.SYSDATE
B.CURRENT_TIMESTAMP
C.LOCALTIMESTAMP
D.CURRENT_DATE
Answer: B

Explanation:

LOCALTIMESTAMP returns a TIMESTAMP value while CURRENT_TIMESTAMP returns a TIMESTAMP WITH


TIME ZONE valueB is correct.

Reference:

https://docs.oracle.com/cd/E11882_01/server.112/e10729/ch4datetime.htm#NLSPG004

Question: 78 CertyIQ
Using the CUSTOMERS table, you need to generate a report that shows 50% of each credit amount in each income
level. The report should NOT show any repeated credit amounts in each income level.
Which query would give the required result?

A.SELECT cust_income_level || "˜ ' || cust_credit_limit * 0.50 AS "50% Credit Limit" FROM customers.
B.SELECT DISTINCT cust_income_level || "˜ ' || cust_credit_limit * 0.50 AS "50% Credit Limit" FROM customers.
C.SELECT DISTINCT cust_income_level, DISTINCT cust_credit_limit * 0.50 AS "50% Credit Limit" FROM
customers.
D.SELECT cust_income_level, DISTINCT cust_credit_limit * 0.50 AS "50% Credit Limit" FROM customers

Answer: B

Explanation:

SELECT DISTINCT cust_income_level || "˜ ' || cust_credit_limit * 0.50 AS "50% Credit Limit" FROM customers.

Question: 79 CertyIQ
Which three statements are true regarding the SQL WHERE and HAVING clauses?

A.The HAVING clause conditions can have aggregating functions.


B.The HAVING clause conditions can use aliases for the columns.
C.The WHERE and HAVING clauses cannot be used together in a SQL statement.
D.The WHERE clause is used to exclude rows before grouping data.
E.The HAVING clause is used to exclude one or more aggregated results after grouping data.

Answer: ADE

Explanation:

A.The HAVING clause conditions can have aggregating functions.(correct)B. The HAVING clause conditions
can use aliases for the columns.(Incorrect: The HAVING clause conditions can not use aliases for the
columns)C. The WHERE and HAVING clauses cannot be used together in a SQL statement.(Incorrect: The
WHERE and HAVING clauses can be used together in a SQL statement)D. The WHERE clause is used to
exclude rows before grouping data.(correct)E. The HAVING clause is used to exclude one or more aggregated
results after grouping data.(correct)
Question: 80 CertyIQ
Which two are true about queries using set operators such as UNION? (Choose two.)

A.In a query containing multiple set operators, INTERSECT always takes precedence over UNION and UNION
ALL.
B.An expression in the first SELECT list must have a column alias for the expression.
C.All set operators are valid on columns of all data types.
D.CHAR columns of different lengths used with a set operator return a VARCHAR2 whose length equals the
longest char value.
E.Queries using set operators do not perform implicit conversion across data type groups (e.g. character,
numeric).

Answer: DE

Explanation:

D.CHAR columns of different lengths used with a set operator return a VARCHAR2 whose length equals the
longest char value.

E.Queries using set operators do not perform implicit conversion across data type groups (e.g. character,
numeric).
Thank you
Thank you for being so interested in the premium exam material.
I'm glad to hear that you found it informative and helpful.

But Wait

I wanted to let you know that there is more content available in the full version.
The full paper contains additional sections and information that you may find helpful,
and I encourage you to download it to get a more comprehensive and detailed view of
all the subject matter.

Download Full Version Now

Total: 374 Questions


Link: https://certyiq.com/papers/oracle/1z0-071

You might also like