Reviewer IT Examtopics 3
Reviewer IT Examtopics 3
Reviewer IT Examtopics 3
Which two are true about data type conversions involving these columns in query
expressions? (Choose two.)
A.
B.
C.
D.
Correct Answer: A
Question #63Topic 1
Examine the description of the EMPLOYEES table:
Which two queries return all rows for employees whose salary is greater than the average
salary in their department? (Choose two.)
A.
B.
C.
D.
E.
Correct Answer: BE
Question #64Topic 1
Which three statements are true about the Oracle join and ANSI join syntax? (Choose
three.)
A. The Oracle join syntax supports creation of a Cartesian product of two tables.
B. The Oracle join syntax only supports right outer joins.
C. The SQL:1999 compliant ANSI join syntax supports creation of a Cartesian
product of two tables.
D. The Oracle join syntax performs less well than the SQL:1999 compliant ANSI join
syntax.
E. The Oracle join syntax supports natural joins.
F. The Oracle join syntax performs better than the SQL:1999 compliant ANSI join
syntax.
G. The SQL:1999 compliant ANSI join syntax supports natural joins.
Correct Answer: ACG
Question #65Topic 1
Which two are true about the NVL, NVL2, and COALESCE functions? (Choose two.)
A. an error
B. 2 rows
C. 0 rows
D. 1 row
Correct Answer: D
Question #68Topic 1
Which two statements execute successfully? (Choose two.)
A.
B.
C.
D.
E.
Correct Answer: AB
Question #69Topic 1
Which three statements are true regarding group functions? (Choose three.)
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.
Suggested Answer: D
Question #72Topic 1
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.
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);
Suggested Answer: D
Question #73Topic 1
Your database instance was shut down normally and then started in NOMOUNT state. You
then execute this command:
You want to generate a report that shows all course IDs irrespective of whether they have
corresponding department IDs or not but no department IDs if they do not have any
courses.
The PROD_ID column is the foreign key in the SALES table referencing the PRODUCTS
table.
The CUST_ID and TIME_ID columns are also foreign keys in the SALES table referencing the
CUSTOMERS and TIMES tables, respectively.
Examine this 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?
A. The NEW_SALES table would get created and all the FOREIGN KEY constraints
defined on the selected columns from the SALES table would be created on the
corresponding columns in the NEW_SALES table.
B. The NEW_SALES table would not get created because the column names in the
CREATE TABLE command and the SELECT clause do not match.
C. The NEW_SALES table would not get created because the DEFAULT value cannot
be specified in the column definition.
D. The NEW_SALES table would get created and all the NOT NULL constraints
defined on the selected columns from the SALES table would be created on the
corresponding columns in the NEW_SALES table.
Suggested Answer: D
Question #83Topic 1
Examine the data in the ORDERS table:
A. 2
B. 1
C. 3
D. 5 01-MAR-2019
E. 3 01-JAN-2015
F. 4 01-FEB-2015
Suggested Answer: BF
Question #84Topic 1
Evaluate the following statement.
Which statement is true regarding the evaluation of rows returned by the subquery in the
INSERT statement?
A. Each row is evaluated by the first WHEN clause and if the condition is false then
the row would be evaluated by the subsequent when clauses.
B. All rows are evaluated by all the three WHEN clauses.
C. Each row is evaluated by the first WHEN clause and if the condition is true, then
the row would be evaluated by the subsequent when clauses.
D. The INSERT statement will return an error because the ELSE clause is missing.
Suggested Answer: B
Question #85Topic 1
Which two statements are true regarding the SQL GROUP BY clause?
A. All existing views and synonyms that refer to the table are invalidated but
retained. Most Voted
B. Any uncommitted transaction in the session is committed. Most Voted
C. Table data and the table structure are deleted. Most Voted
D. All the table's indexes if any exist, are invalidated but retained.
E. Table data is deleted but the table structure is retained.
Suggested Answer: ABC
Question #87Topic 1
You execute the SQL statement:
A. It fails because the NOT NULL and DEFAULT options cannot be combined for the
same column.
B. It succeeds and CITY can contain only "˜SEATTLE' or null for all rows.
C. It fails because the condition for the CNAMES constraint is not valid.
D. It succeeds and an index is created for CITIZEN_ID. Most Voted
Suggested Answer: D
Question #88Topic 1
Evaluate the following CREATE TABLE commands:
CREATE_TABLE orders -
(ord_no NUMBER (2) CONSTRAINT ord_pk PRIMARY KEY,
ord_date DATE,
cust_id NUMBER (4) );
The above command fails when executed. What could be the reason?
Which two statements will insert a row into the EMPLOYEES table? (Choose two.)
A. The statement would not execute because the positional notation instead of the
column name should be used with the ORDER BY clause.
B. The statement would execute successfully and display all the rows in the
ascending order of DEPARTMENT_ID.
C. The statement would execute successfully but it will ignore the ORDER BY clause
and display the rows in random order.
D. The statement would not execute because the ORDER BY clause should appear
only at the end of the SQL statement, that is, in the last SELECT statement.
Suggested Answer: D
Question #93Topic 1
View the Exhibit and examine the description for the SALES and CHANNELS tables.
(Choose the best answer.)
A. The statement will fail because the subquery in the VALUES clause is not
enclosed within single quotation marks.
B. The statement will fail because a subquery cannot be used in a VALUES clause.
C. The statement will execute and a new row will be inserted in the SALES table.
D. The statement will fail because the VALUES clause is not required with the
subquery.
Suggested Answer: C
Question #94Topic 1
View the Exhibit and examine the description of the ORDERS table.
Which two WHERE clause conditions demonstrate the correct usage of conversion
functions? (Choose two.)
SELECT EMPLOYEE_ID -
FROM EMPLOYEES -
WHERE JOB_ID = 'SA_MAN'
-------------------------------------
SELECT EMPLOYEE_ID -
FROM JOB_HISTORY -
WHERE JOB_ID = 'SA_MAN';
Choose two correct SET operators which would cause the query to return the desired result.
A. UNION
B. MINUS
C. INTERSECT
D. UNION ALL
Hide Answer
Suggested Answer: ACD
Question #97Topic 1
Examine the data in the CUST_NAME column of the CUSTOMERS table:
You want to display the CUST_NAME values where the last name starts with Mc or MC.
Which two WHERE clauses give the required result? (Choose two.)
A. During parsing, a SQL statement containing literals in the WHERE clause that has
been executed by any session and which is cached in memory, is always reused for
the current execution.
B. During execution, the Oracle server may read data from storage if the required
data is not already in memory.
C. During row source generation, rows that satisfy the query are retrieved from the
database and stored in memory.
D. During optimization, execution plans are formulated based on the statistics
gathered by the database instance, and the lowest cost plan is selected for
execution.
Suggested Answer: B
Question #100Topic 1
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 and 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.
Suggested Answer: D
Question #101Topic 1
View the Exhibit and examine the structure of the ORDER_ITEMS table.
You must select the ORDER_ID of the order that has the highest total value among all the
orders in the ORDER_ITEMS table.
Which query would produce the desired result?
A.
B.
C.
D.
E.
Hide Answer
Suggested Answer: D
Question #104Topic 1
Which two statements best describe the benefits of using the WITH clause? (Choose two.)
A. It can improve the performance of a large query by storing the result of a query
block having the WITH clause in the session's temporary tablespace.
B. It enables sessions to reuse the same query block in a SELECT statement, if it
occurs more than once in a complex query.
C. It enables sessions to store a query block permanently in memory and use it to
create complex queries.
D. It enables sessions to store the results of a query permanently.
Suggested Answer: AB
Question #105Topic 1
Which three statements are true regarding subqueries? (Choose three.)
A. SELECT order_id, order_date FROM orders WHERE order_date > ANY (SELECT
order_date FROM orders WHERE customer_id = 101);
B. SELECT order_id, order_date FROM orders WHERE order_date > ALL (SELECT
MAX(order_date) FROM orders ) AND customer_id = 101;
C. SELECT order_id, order_date FROM orders WHERE order_date > ALL (SELECT
order_date FROM orders WHERE customer_id = 101);
D. SELECT order_id, order_date FROM orders WHERE order_date > IN (SELECT
order_date FROM orders WHERE customer_id = 101);
Suggested Answer: C
Question #108Topic 1
You must display details of all users whose username contains the string 'ch_'. (Choose the
best answer.)
Which query generates the required output?
A. The nested query executes after the outer query returns the row.
B. The nested query executes first and then the outer query executes.
C. The outer query executes only once for the result returned by the inner query.
D. Each row returned by the outer query is evaluated for the results returned by the
inner query.
Suggested Answer: AD
Question #114Topic 1
Which two statement are true regarding table joins available in the Oracle Database server?
(Choose two.)
A. You can use the ON clause to specify multiple conditions while joining tables.
B. You can explicitly provide the join condition with a NATURAL JOIN.
C. You can use the JOIN clause to join only two tables.
D. You can use the USING clause to join tables on more than one column.
Suggested Answer: AD
Question #115Topic 1
You issued this command:
Which two JOIN operations can be used to obtain the required output?
A. The values in the SALARY column would be returned in descending order for all
employees having the same value in the DEPARTMENT_ID and FIRST_NAME
column.
B. The values in the FIRST_NAME column would be returned in ascending order for
all employees having the same value in the DEPARTMENT_ID column.
C. The values in the SALARY column would be returned in descending order for all
employees having the same value in the DEPARTMENT_ID column.
D. The values in all columns would be returned in descending order.
E. The values in the FIRST_NAME column would be returned in descending order for
all employees having the same value in the DEPARTMENT_ID column.
Suggested Answer: AB
Question #119Topic 1
Examine the structure of the SALES table.
Examine this statement:
Which two statements are true about the SALES1 table? (Choose two.)
A. It will not be created because the column-specified names in the SELECT and
CREATE TABLE clauses do not match.
B. It will have NOT NULL constraints on the selected columns which had those
constraints in the SALES table.
C. It will not be created because of the invalid WHERE clause.
D. It is created with no rows.
E. It has PRIMARY KEY and UNIQUE constraints on the selected columns which had
those constraints in the SALES table.
Suggested Answer: BD
Question #120Topic 1
Examine this SELECT statement and view the Exhibit to see its output:
SELECT constraints_name, constraints_type, search_condition, r_constraints_name,
delete_rule, status,
FROM user_constraints -
WHERE table_name = 'ORDERS';
Which two statements are true about the output? (Choose two.)
A. The DELETE_RULE column indicates the desired state of related rows in the child
table when the corresponding row is deleted from the parent table.
B. The R_CONSTRAINT_NAME column contains an alternative name for the
constraint.
C. In the second column, 'c' indicates a check constraint.
D. The STATUS column indicates whether the table is currently in use.
Suggested Answer: AC
Question #121Topic 1
Which two statements are true regarding constraints? (Choose two.)
A. All constraints can be defined at the column level and at the table level.
B. A constraint can be disabled even if the constraint column contains data.
C. A column with the UNIQUE constraint can contain NULLS.
D. A foreign key column cannot contain NULLS.
E. A constraint is enforced only for INSERT operations.
Suggested Answer: BC
Question #122Topic 1
Which two statements are true regarding working with dates? (Choose two.)
A. The RR date format automatically calculates the century from the SYSDATE
function but allows the session user to enter the century.
B. The RR date format automatically calculates the century from the SYSDATE
function and does not allow a session user to enter the century.
C. The default internal storage of dates is in character format.
D. The default internal storage of dates is in numeric format.
Suggested Answer: AD
Question #123Topic 1
View the Exhibit and examine the structure of ORDERS and CUSTOMERS tables. (Choose
the best answer.)
A. It would not execute because a subquery cannot be used in the WHERE clause of
an UPDATE statement.
B. It would not execute because two tables cannot be referenced in a single
UPDATE statement.
C. It would execute and restrict modifications to the columns specified in the
SELECT statement.
D. It would not execute because a SELECT statement cannot be used in place of a
table name.
Suggested Answer: C
Question #124Topic 1
View the Exhibit and examine the structure of the PRODUCTS table.
You must display the category with the maximum number of items.
You issue this query:
A. It generates an error because = is not valid and should be replaced by the IN
operator.
B. It executes successfully but does not give the correct output.
C. It executes successfully and gives the correct output.
D. It generate an error because the subquery does not have a GROUP BY clause.
Suggested Answer: D
Question #125Topic 1
Examine the structure of the MEMBERS table: (Choose the best answer.)
A. It displays all cities in descending order, within which the last names are further
sorted in descending order.
B. It fails because a column alias cannot be used in the ORDER BY clause.
C. It fails because a column number and a column alias cannot be used together in
the ORDER BY clause.
D. It displays all cities in ascending order, within which the last names are further
sorted in descending order.
Suggested Answer: D
Question #126Topic 1
View and Exhibit and examine the structure and data in the INVOICE table.
Which two statements are true regarding data type conversion in query expressions?
(Choose two.)
You must display the details of employees who have manager with MANAGER_ID 100, who
were hired in the past 6 months and who have salaries greater than 10000.
Which query would retrieve the required result?
A. SELECT last_name, hire_date, salary FROM employees WHERE salary > 10000
UNION ALL SELECT last_name, hire_date, salary FROM employees WHERE
manager_ID = (SELECT employee_id FROM employees WHERE employee_id = 100)
INTERSECT SELECT last_name, hire_date, salary FROM employees WHERE
hire_date > SYSDATE- 180;
B. SELECT last_name, hire_date, salary FROM employees WHERE manager_id =
(SELECT employee_id FROM employees WHERE employee_id = 100) UNION ALL
(SELECT last_name, hire_date, salary FROM employees WHERE hire_date >
SYSDATE -180 INTERSECT SELECT last_name, hire_date, salary FROM employees
WHERE salary > 10000);
C. SELECT last_name, hire_date, salary FROM employees WHERE manager_id =
(SELECT employee_id FROM employees WHERE employee_id = '100') UNION
SELECT last_name, hire_date, salary FROM employees WHERE hire_date > SYSDATE
-180 INTERSECT SELECT last_name, hire_date, salary FROM employees WHERE
salary > 10000;
D. (SELECT last_name, hire_date, salary FROM employees WHERE salary > 10000
UNION ALL SELECT last_name, hire_date, salary FROM employees WHERE
manager_ID = (SELECT employee_id FROM employees WHERE employee_id = 100))
UNION SELECT last_name, hire_date, salary FROM employees WHERE hire_date >
SYSDATE -180;
Suggested Answer: C
Question #128Topic 1
Examine the structure of the PROMOTIONS table: (Choose the best answer.)
A. DATE
B. NUMBER
C. TIMESTAMP
D. INTERVAL DAY TO SECOND
E. INTERVAL YEAR TO MONTH
Suggested Answer: D
Question #130Topic 1
Examine the structure of the CUSTOMERS table: (Choose two.)
A. Subquery
B. Self-join
C. Full outer-join with self-join
D. Left outer-join with self-join
E. Right outer-join with self-join
Suggested Answer: AB
Question #131Topic 1
Which two are the minimal requirements for a self-join? (Choose two.)
A. There is only one subquery in the outer query and the inner query returns one or
more values
B. The inner query returns a single value to the outer query.
C. The inner query uses an aggregating function and returns one or more values.
D. The inner query returns one or more values and the outer query returns a single
value.
Suggested Answer: B
Question #135Topic 1
You must write a query that prompts users for column names and conditions every time it
is executed.
The user must be prompted only once for the table name.
Which statement achieves those objectives?
A. The data type returned, can be different from the data type of the argument that
is referenced.
B. They can return multiple values of more than one data type.
C. They can accept only one argument.
D. They can be nested up to only two levels.
E. They can be used in SELECT, WHERE, and ORDER BY clauses.
F. They can accept column names, expressions, variable names, or a user-supplied
constants as arguments.
Suggested Answer: AEF
Question #137Topic 1
View the Exhibit and examine the structure in the DEPARTMENTS tables. (Choose two.)
A. ORDER BY DEPT_NAME;
B. ORDER BY DEPT_ID;
C. ORDER BY 'b';
D. ORDER BY 3;
Suggested Answer: BD
Question #138Topic 1
Which two statements are true regarding the WHERE and HAVING clauses in a SELECT
statement? (Choose two.)
A. The WHERE and HAVING clauses can be used in the same statement only if they
are applied to different columns in the table.
B. The aggregate functions and columns used in the HAVING clause must be
specified in the SELECT list of the query.
C. The WHERE clause can be used to exclude rows after dividing them into groups.
D. The HAVING clause can be used with aggregate functions in subqueries. Most
Voted
E. The WHERE clause can be used to exclude rows before dividing them into
groups. Most Voted
Suggested Answer: DE
Question #139Topic 1
You must create a table EMPLOYEES in which the values in the columns EMPLOYEES_ID
and LOGIN_ID must be unique and not null.
Which two SQL statements would create the required table? (Choose two.)
A. A set of one or more sequential queries in which generally the result of the inner
query is used as the search value in the outer query.
B. A set of sequential queries, all of which must return values from the same table.
C. A set of sequential queries, all of which must always return a single value.
D. A SELECT statement that can be embedded in a clause of another SELECT
statement only.
Suggested Answer: A
Question #143Topic 1
Which three statements are true reading subqueries? (Choose three.)
A. It generates an error because multiple conditions cannot be specified for the
WHEN clause.
B. It executes successfully and gives the required result.
C. It generates an error because CASE cannot be used with group functions.
D. It generates an error because NULL cannot be specified as a return value.
Suggested Answer: B
Question #145Topic 1
Which two statements are true regarding multiple-row subqueries? (Choose two.)
The CUSTOMERS table contains the current location of all currently active customers.
The CUST_HISTORY table stores historical details relating to any changes in the location of
all current as well as previous customers who are no longer active with the company.
You need to find those customers who have never changed their address.
Which SET operator would you use to get the required output?
A. INTERSECT
B. UNION ALL
C. MINUS
D. UNION
Suggested Answer: C
Question #147Topic 1
View the Exhibit and examine PRODUCTS and ORDER_ITEMS tables.
You executed the following query to display PRODUCT_NAME and the number of times the
product has been ordered:
SELECT p.product_name, i.item_cnt
FROM (SELECT product_id, COUNT (*) item_cnt
FROM order_items -
GROUP BY product_id) i RIGHT OUTER JOIN products p
ON i.product_id = p.product_id;
What would happen when the above statement is executed?