View the Exhibit and examine the structure of the CUSTOMERS and CUST_HISTORY
tables.
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
MINUS
Evaluate the following statement.
INSERT ALL
WHEN order_total < 10000 THEN
INTO small_orders
WHEN order_total > 10000 AND order_total < 20000 THEN
INTO medium_orders
WHEN order_total > 200000 AND order_total < 20000 THEN
INTO large_orders
SELECT order_id, order_total, customer_id
FROM orders;
Which statement is true regarding the evaluation of rows returned by the subquery in the
INSERT statement?
A.
They are evaluated by all the three WHEN clauses regardless of the results of the
evaluation of any other WHEN clause.
B.
They are evaluated by the first WHEN clause. If the condition is true, then the row would
be evaluated by the subsequent WHEN clauses.
C.
They are evaluated by the first WHEN clause. If the condition is false, then the row
would be evaluated by the subsequent WHEN clauses.
D.
The insert statement would give an error because the ELSE clause is not present for
support in case none of WHEN clauses are true.
They are evaluated by all the three WHEN clauses regardless of the results of the
evaluation of any other WHEN clause.
http://psoug.org/definition/WHEN.htm
View the Exhibit and examine the structure of the ORDERS table. (Choose the best
answer.)
You must select ORDER_ID and ORDER_DATE for all orders that were placed after the
last order placed by CUSTOMER_ID 101.
Which query would give you the desired result?
A.
SELECT order_id, order_date FROM ordersWHERE order_date > ANY(SELECT
order_date FROM orders WHERE customer_id = 101);
B.
SELECT order_id, order_date FROM ordersWHERE order_date > ALL(SELECT
MAX(order_date) FROM orders ) AND customer_id = 101;
C.
SELECT order_id, order_date FROM ordersWHERE order_date > ALL(SELECT
order_date FROM orders WHERE customer_id = 101);
D.
SELECT order_id, order_date FROM ordersWHERE order_date > IN(SELECT
order_date FROM orders WHERE customer_id = 101);
SELECT order_id, order_date FROM ordersWHERE order_date > ALL(SELECT
order_date FROM orders WHERE customer_id = 101);
You issue the following command to drop the PRODUCTS table: (Choose all that apply.)
SQL > DROP TABLE products;
Which three statements are true about the implication of this command?
A.
All data along with the table structure is deleted.
B.
A pending transaction in the session is committed.
C.
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.
All data along with the table structure is deleted.
A pending transaction in the session is committed.
All views and synonyms on the table remain but they are invalidated.
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 dSET city = ALL (SELECT cityFROM locations lWHERE d.location_id =
l.location_id);
B.
UPDATE dept dSET city = (SELECT cityFROM locations l)WHERE d.location_id =
l.location_id;
C.
UPDATE dept dSET city = ANY (SELECT cityFROM locations l)
D.
UPDATE dept dSET city = (SELECT cityFROM locations lWHERE d.location_id =
l.location_id);
UPDATE dept dSET city = (SELECT cityFROM locations lWHERE d.location_id =
l.location_id);
View the exhibit and examine the description of the DEPARTMENTS and EMPLOYEES
tables.
The retrieve data for all the employees for their EMPLOYEE_ID, FIRST_NAME, and
DEPARTMENT NAME, the following SQL statement was written:
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.
The EMPLOYEES and DEPARTMENTS tables have more than one column with the
same column name and data type.
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
Evaluate the following SELECT statement and view the exhibit to examine its output:
SELECT constraint_name, constraint_type, search_condition, r_constraint_name,
delete_rule, status,
FROM user_constraints
WHERE table_name = 'ORDERS';
CONSTRAINT_NAME
CON
SEARCH_CONDITION
R_CONSTRAINT_NAME
DELETE_RULE
STATUS
ORDER_DATE_NN
C
"ORDER_DATE" IS NOT NULL
ENABLED
ORDER_CUSTOMER_ID_NN
"CUSTOMER_ID" IS NOT NULL
ENABLED
ORDER_MODE_LOV
C
order _mode in ('direct', 'online')
ENABLED
ORDER TOTAL MIN
C
order total >= 0
ENABLED
ORDER PK
P
ENABLED
ORDERS CUSTOMER ID
R
CUSTOMERS ID
SET NULL
ENABLED
ORDERS SALES REP
R
EMP EMP ID
SET NULL
ENABLED
Which two statements are true about the output? (Choose two.)
A.
The R_CONSTRAINT_NAME column gives the alternative name for the constraint.
B.
In the second column, 'c' indicates a check constraint.
C.
The STATUS column indicates whether the table is currently in use.
D.
The column DELETE_RULE decides the state of the related rows in the child table when
the corresponding row is deleted from the parent table.
In the second column, 'c' indicates a check constraint.
The column DELETE_RULE decides the state of the related rows in the child table when
the corresponding row is deleted from the parent table.
View the exhibits and examine the structures of the COSTS and PROMOTIONS tables.
Evaluate the following SQL statement:
SQL> SELECT prod_id FROM costs
WHERE promo_id IN (SELECT promo_id FROM promotions
WHERE promo_cost < ALL
(SELECT MAX(promo_cost) FROM promotions
GROUP BY (promo_end_datepromo_
begin_date)));
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.
It displays prod IDs in the promos which cost less than the highest cost in the same time
interval.
Which two statements are true regarding roles? (Choose two.)
A.
A role can be granted to itself.
B.
A role can be granted to PUBLIC.
C.
A user can be granted only one role at any point of time.
D.
The REVOKE command can be used to remove privileges but not roles from other
users.
E.
Roles are named groups of related privileges that can be granted to users or other roles
A role can be granted to PUBLIC.
Roles are named groups of related privileges that can be granted to users or other roles
References:
http://docs.oracle.com/cd/E25054_01/network.1111/e16543/authorization.htm#autoId28
Which three statements are true regarding the usage of the WITH clause in complex
correlated subqueries: (Choose three.)
A.
It can be used only with the SELECT clause.
B.
The WITH clause can hold more than one query.
C.
If the query block name and the table name are the same, then the table name takes
precedence.
D.
The query name in the WITH clause is visible to other query blocks in the WITH clause
as well as to the main query block
It can be used only with the SELECT clause.
The WITH clause can hold more than one query.
The query name in the WITH clause is visible to other query blocks in the WITH clause
as well as to the main query block
View the Exhibit and examine the structure of ORDERS and CUSTOMERS tables.
(Choose the best answer.)
You executed this UPDATE statement:
UPDATE
( SELECT order_date, order_total, customer_id FROM orders)
Set order_date = '22-mar-2007'
WHERE customer_id IN
(SELECT customer_id FROM customers
WHERE cust_last_name = 'Roberts' AND credit_limit = 600);
Which statement is true regarding the execution?
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.
It would execute and restrict modifications to the columns specified in the SELECT
statement.
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.
Use Quote (q) operator and delimiter to allow the use of single quotation mark in the
literal character string.
B.
Enclose the literal character string in the SELECT clause within the double quotation
marks.
C.
Do not enclose the character literal string in the SELECT clause within the single
quotation marks.
D.
Use escape character to negate the single quotation mark inside the literal character
Use Quote (q) operator and delimiter to allow the use of single quotation mark in the
literal character string.
References:
http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements003.htm
Page 2 out of 30 Pages |
Previous |