Sunteți pe pagina 1din 12

Page 1 of 12

Item: 1 (Ref:1z0-007e.5.2.8)

The SUPPLIER table contains these columns:

S_ID NUMBER PK
NAME VARCHAR2(30)
LOCATION_ID NUMBER
ORDER_DT DATE
ORDER_AMOUNT NUMBER(8,2)

Which clauses represent valid uses of aggregate functions? (Choose all that apply.)

c FROM MAX(order_dt)
d
e
f
g

c SELECT SUM(order_dt)
d
e
f
g

c SELECT SUM(order_amount)
d
e
f
g

c SELECT MAX(AVG(order_amount))
d
e
f
g

c WHERE MIN(order_amount) = order_amount


d
e
f
g

c SELECT location_id, order_dt, MAX(order_amount)


d
e
f
g

Objective:
Aggregating Data using Group Functions

Sub-Objective:
Use group functions
Item: 2 (Ref:1z0-007e.2.2.5)

Click the Exhibit(s) button to examine the data in the PRODUCT table.

Evaluate this SELECT statement:

SELECT description, cost


FROM product
ORDER BY cost, quantity;

Which statements are true? (Choose all that apply.)

c The PRODUCT_ID value for the first record displayed is 220.


d
e
f
g

c The PRODUCT_IDs value for the last two records displayed are 140 and 126.
d
e
f
g

c The DESCRIPTION value for the first two records displayed is 'C 2pk-battery'.
d
e
f
g

c The DESCRIPTION value for the first two records displayed is 'AA 2pk-battery'.
d
e
f
g

c No row with a PRODUCT_ID of 220 is displayed.


d
e
f
g

Copyright © 2010 Self Test Software, Inc. All Rights Reserved


Page 2 of 12

Objective:
Restricting and Sorting Data

Sub-Objective:
Sort the rows retrieved by a query
Item: 3 (Ref:1z0-007e.4.1.1)

Examine the structures of the PRODUCT and STYLE tables:

PRODUCT
----------------
PRODUCT_ID NUMBER
PRODUCT_NAME VARCHAR2(25)
SUPPLIER_ID NUMBER
QTY_IN_STOCK NUMBER
QTY_ON_ORDER NUMBER
REORDER_LEVEL NUMBER

STYLE
---------------
STYLE_ID NUMBER
NAME VARCHAR2(15)
COLOR VARCHAR2(10)

You want to create a report displaying all possible PRODUCT_ID and STYLE_ID combinations. Which three
queries could you use? (Choose three.)

c SELECT style_id, product_id


d
e
f
g
FROM product
CROSS JOIN style
ON (style_id = product_id);
c SELECT style_id, product_id
d
e
f
g
FROM product
CROSS JOIN style;
c SELECT style_id, product_id
d
e
f
g
FROM style
JOIN product
ON style_id = product_id;
c SELECT style_id, product_id
d
e
f
g
FROM product
NATURAL JOIN style;
c SELECT style_id, product_id
d
e
f
g
FROM style
JOIN product
USING (style_id);

Copyright © 2010 Self Test Software, Inc. All Rights Reserved


Page 3 of 12
c SELECT style_id, product_id
d
e
f
g
FROM style, product;

Objective:
Displaying Data from Multiple Tables

Sub-Objective:
Write SELECT statements to access data from more than one table using equality and nonequality joins
Item: 4 (Ref:1z0-007e.4.1.3)

Click the Exhibit(s) button to examine the structures of the PO_HEADER and SUPPLIER tables.

Evaluate this SQL statement:

SELECT p.po_num, s.supplier_name, p.po_date, p.po_total


FROM po_header p, supplier s
WHERE p.supplier_id = s.supplier_id;

Which two SQL statements will produce identical results? (Choose two.)

c SELECT p.po_num, s.supplier_name, p.po_date, p.po_total


d
e
f
g
FROM po_header p JOIN supplier s
USING (p.supplier_id);
c SELECT po_num, supplier_name, po_date, po_total
d
e
f
g
FROM po_header NATURAL JOIN supplier;
c SELECT p.po_num, s.supplier_name, p.po_date, p.po_total
d
e
f
g
FROM po_header p JOIN supplier s
USING (p.supplier_id = s.supplier_id);
c SELECT p.po_num, s.supplier_name, p.po_date, p.po_total
d
e
f
g
FROM po_header p JOIN supplier s
USING (supplier_id);
c SELECT p.po_num, s.supplier_name, p.po_date, p.po_total
d
e
f
g
FROM po_header p NATURAL JOIN supplier s
USING (supplier_id);

Objective:
Displaying Data from Multiple Tables

Sub-Objective:
Write SELECT statements to access data from more than one table using equality and nonequality joins

Copyright © 2010 Self Test Software, Inc. All Rights Reserved


Page 4 of 12
Item: 5 (Ref:1z0-007e.3.3.8)

Which three statements concerning explicit data type conversions are true. (Choose three.)

c A number value may be converted to a date value using the TO_DATE function.
d
e
f
g

c A date value may be converted to a number value using the TO_NUMBER function.
d
e
f
g

c A character value may be converted to a date value using the TO_DATE function.
d
e
f
g

c A date value may be converted to a character value using the TO_DATE function.
d
e
f
g

c A date value may be converted to a character string using the TO_CHAR function.
d
e
f
g

c A number value may be converted to a character string using the TO_CHAR function.
d
e
f
g

c A number value may be converted to a character value using the TO_NUMBER function.
d
e
f
g

Objective:
Single-Row Functions

Sub-Objective:
Use conversion functions
Item: 6 (Ref:1z0-007e.6.3.3)

Which two statements regarding the valid use of single-row and multiple-row subqueries are true? (Choose two.)

c Single-row subqueries can only be used in a WHERE clause.


d
e
f
g

c Multiple-row subqueries can be used with the LIKE operator.


d
e
f
g

c Single-row operators can only be used with single-row subqueries.


d
e
f
g

c Single- and multiple-row subqueries can be used with the BETWEEN operator.
d
e
f
g

c Multiple-row subqueries can be used with both single-row and multiple-row operators.
d
e
f
g

c Multiple-row subqueries can be used in a WHERE clause and the INTO portion of an INSERT statement.
d
e
f
g

Objective:
Subqueries

Sub-Objective:
List the types of subqueries
Item: 7 (Ref:1z0-007e.6.3.4)

Examine the structures of the BOOK and PUBLISHER tables:

Copyright © 2010 Self Test Software, Inc. All Rights Reserved


Page 5 of 12

BOOK
----------
BOOK_ID VARCHAR2(25) PK
BOOK_NAME VARCHAR2(50)
PUBLISHER_ID NUMBER
COST NUMBER(5,2)
PRICE NUMBER(5,2)

PUBLISHER
--------------------
ID NUMBER PK
NAME VARCHAR2(30)
LOCATION VARCHAR2(20)

Which two SQL statements correctly use subqueries? (Choose two.)

c UPDATE book
d
e
f
g
SET price = price * 2
WHERE publisher_id IN
(SELECT id
FROM publisher
WHERE UPPER(location) = 'BOSTON');
c UPDATE book
d
e
f
g
SET price = price * 2
WHERE publisher_id =
(SELECT id
FROM publisher
WHERE UPPER(location) = 'BOSTON');
c SELECT book_name, location, price
d
e
f
g
FROM book
WHERE publisher_id IN (SELECT id
FROM publisher
WHERE id = 54);
c SELECT book_name, price, cost
d
e
f
g
FROM book
WHERE publisher_id = (SELECT id
FROM publisher
WHERE LOWER(name) = 'master press');
c SELECT book_name, price, cost
d
e
f
g
FROM book
WHERE publisher_id IN (SELECT id
FROM publisher p JOIN book b
ON (p.id = b.publisher_id));

Objective:
Subqueries

Sub-Objective:
List the types of subqueries
Item: 8 (Ref:1z0-007e.4.1.2)

Examine the structures of the PRODUCT and SUPPLIER tables:

PRODUCT
-----------------
PRODUCT_ID NUMBER
PRODUCT_NAME VARCHAR2(25)
SUPPLIER_ID NUMBER
CATEGORY_ID NUMBER
QTY_PER_UNIT NUMBER

Copyright © 2010 Self Test Software, Inc. All Rights Reserved


Page 6 of 12
UNIT_PRICE NUMBER(7,2)
QTY_IN_STOCK NUMBER
QTY_ON_ORDER NUMBER
REORDER_LEVEL NUMBER

SUPPLIER
-----------------
SUPPLIER_ID NUMBER
SUPPLIER_NAME VARCHAR2(25)
ADDRESS VARCHAR2(30)
CITY VARCHAR2(25)
REGION VARCHAR2(10)
POSTAL_CODE VARCHAR2(11)

You want to create a query that will return an alphabetical list of products including the name of each product's
supplier. Only products in the PRODUCT table that have a supplier assigned should be included in your report.

Which two queries could you use? (Choose two.)

c SELECT p.product_name, s.supplier_name


d
e
f
g
FROM product p
LEFT OUTER JOIN supplier s
ON p.supplier_id = s.supplier_id
ORDER BY p.product_name;
c SELECT p.product_name, s.supplier_name
d
e
f
g
FROM product p
JOIN supplier s
ON (supplier_id)
ORDER BY p.product_name;
c SELECT product_name, supplier_name
d
e
f
g
FROM product
NATURAL JOIN supplier
ORDER BY product_name;
c SELECT p.product_name, s.supplier_name
d
e
f
g
FROM product p
JOIN supplier s
USING (p.supplier_id)
ORDER BY p.product_name;
c SELECT product_name, supplier_name
d
e
f
g
FROM product
JOIN supplier
USING (supplier_id)
ORDER BY product_name;

Objective:
Displaying Data from Multiple Tables

Sub-Objective:
Write SELECT statements to access data from more than one table using equality and nonequality joins
Item: 9 (Ref:1z0-007e.5.4.3)

Which two statements about the evaluation of clauses in a SELECT statement are true? (Choose two.)

c The Oracle Server will evaluate a HAVING clause before a WHERE clause.
d
e
f
g

c The Oracle Server will evaluate a WHERE clause before a GROUP BY clause.
d
e
f
g

c The Oracle Server will evaluate a GROUP BY clause before a HAVING clause.
d
e
f
g

c The Oracle Server will evaluate an ORDER BY clause before a WHERE clause.
d
e
f
g
The Oracle Server will evaluate an ORDER BY clause before a HAVING clause.

Copyright © 2010 Self Test Software, Inc. All Rights Reserved


Page 7 of 12
c
d
e
f
g

Objective:
Aggregating Data using Group Functions

Sub-Objective:
Include or exclude grouped rows by using the HAVING clause
Item: 10 (Ref:1z0-007e.1.3.3)

Which statements pertaining to SQL and iSQL*Plus are true? (Choose all that apply.)

c SQL runs on a browser.


d
e
f
g

c SQL includes a continuation character.


d
e
f
g

c iSQL*Plus can format query results.


d
e
f
g

c SQL and iSQL*Plus are command languages.


d
e
f
g

c iSQL*Plus can send SQL statements to the server.


d
e
f
g

Objective:
Writing Basic SQL Select Statements

Sub-Objective:
Differentiate between SQL statements and iSQL*Plus commands
Item: 11 (Ref:1z0-007e.6.2.1)

Which of two statements regarding the use of subqueries are true? (Choose two.)

c A subquery used with the IN operator must return multiple rows.


d
e
f
g

c A subquery can be used in a CREATE VIEW statement, regardless of the number of rows it returns.
d
e
f
g

c A subquery can be used in the VALUES clause of an INSERT statement, if it returns more than one row.
d
e
f
g

c A subquery can be used in the SET clause of an UPDATE statement, regardless of the number of rows it
d
e
f
g
returns.
c A subquery used in an INTO clause of a SELECT statement must return only one column, but can return
d
e
f
g
multiple rows.
c A subquery CANNOT be used in the GROUP BY clause of a SELECT statement.
d
e
f
g

Objective:
Subqueries

Sub-Objective:
Define subqueries
Item: 12 (Ref:1z0-007e.1.2.11)

The STUDENT table contains these columns:

ID NUMBER(9) Primary Key


LAST_NAME VARCHAR2(25)
FIRST_NAME VARCHAR2(25)
ENROLL_DATE DATE

Copyright © 2010 Self Test Software, Inc. All Rights Reserved


Page 8 of 12
The STUDENT table contains this data:

ID 989958900
FIRST_NAME Jennifer
LAST_NAME Jones
ENROLL_DATE 12-SEP-01

You created a report that displays the column headings and data results. Click the Exhibit(s) button to examine
the output.

Which two statements concerning this report's SELECT statement are true? (Choose two.)

c A format mask must have been used on the ENROLL_DATE column.


d
e
f
g

c The LAST_NAME and FIRST_NAME columns are concatenated together.


d
e
f
g

c One column alias is used for the LAST_NAME and FIRST_NAME columns.
d
e
f
g

c The display lengths of the LAST_NAME and FIRST_NAME columns are increased.
d
e
f
g

c Separate column aliases are used for the LAST_NAME, FIRST_NAME, and ENROLL_DATE columns.
d
e
f
g

Objective:
Writing Basic SQL Select Statements

Sub-Objective:
Execute a basic Select statement
Item: 13 (Ref:1z0-007e.3.1.4)

Which three functions can be used to manipulate character, number, and date column values? (Choose three.)

c RPAD
d
e
f
g

c TRUNC
d
e
f
g

c ROUND
d
e
f
g

c INSTR
d
e
f
g

c CONCAT
d
e
f
g

Objective:
Single-Row Functions

Sub-Objective:
Describe various types of functions available in SQL
Item: 14 (Ref:1z0-007e.7.2.1)

Evaluate this SQL*Plus command:

Copyright © 2010 Self Test Software, Inc. All Rights Reserved


Page 9 of 12
COLUMN teacher_name HEADING 'Teacher' FORMAT A25

Which two tasks will this command accomplish? (Choose two.)

c It will set the TEACHER_NAME column heading to 'Teacher'.


d
e
f
g

c It will center the column heading of the TEACHER_NAME column.


d
e
f
g

c It will limit the TEACHER_NAME column heading to 25 characters.


d
e
f
g

c It will set the display width of the TEACHER_NAME column to 25.


d
e
f
g

c It will display the current settings for the TEACHER_NAME column.


d
e
f
g

Objective:
Producing Readable Output with iSQL*Plus

Sub-Objective:
Produce more readable output
Item: 15 (Ref:1z0-007e.3.1.1)

Which three function descriptions are true? (Choose three.)

c The SYSDATE function returns the host machine date and time.
d
e
f
g

c The NVL single-row function can be used on VARCHAR2 columns.


d
e
f
g

c The LENGTH character function returns the number of characters in an expression.


d
e
f
g

c The ROUND number function returns a number rounded to the specified column value.
d
e
f
g

c The TRUNC date function returns a date with the time portion of the day truncated to the specified format
d
e
f
g
unit.
c The SUBSTR character function replaces a portion of a string, beginning at a defined character position for a
d
e
f
g
defined length.

Objective:
Single-Row Functions

Sub-Objective:
Describe various types of functions available in SQL
Item: 16 (Ref:1z0-007e.5.1.2)

You want to produce a report containing the total number of orders placed for a particular time period, including
the total value of the orders. Which two aggregate functions should you use in your SQL statement? (Choose
two.)

c SUM
d
e
f
g

c STOT
d
e
f
g

c TSUM
d
e
f
g

c VALUE
d
e
f
g

c COUNT
d
e
f
g

c STDDEV
d
e
f
g

Copyright © 2010 Self Test Software, Inc. All Rights Reserved


Page 10 of 12
Objective:
Aggregating Data using Group Functions

Sub-Objective:
Identify the available group functions
Item: 17 (Ref:1z0-007e.2.1.7)

Click the Exhibit(s) button to examine the structure of the LINE_ITEM table.

You want to display order id numbers, product id numbers, and the quantity of the product ordered with these
desired results:

1. The volume of the item ordered must be 50 or greater.


2. The display must be sorted from the lowest to the highest by order number and then by product number.
3. The items must belong to order numbers ranging from 1800 to 1900.

Evaluate this SQL script:

SELECT order_id, product_id, quantity


FROM line_item
WHERE quantity >= 50
AND order_id IN(1800, 1900)
ORDER BY order_id, product_id;

What does the proposed solution provide?

j one of the desired results


k
l
m
n

j two of the desired results


k
l
m
n

j all of the desired results


k
l
m
n

j an error statement
k
l
m
n

Objective:
Restricting and Sorting Data

Sub-Objective:
Limit the rows retrieved by a query
Item: 18 (Ref:1z0-007e.7.3.1)

Evaluate this iSQL*Plus command:

START process_batch.sql

Which iSQL*Plus command will achieve the same results?

j &process_batch.sql
k
l
m
n

Copyright © 2010 Self Test Software, Inc. All Rights Reserved


Page 11 of 12
j @ process_batch.sql
k
l
m
n

j GET process_batch.sql
k
l
m
n

j SAVE process_batch.sql
k
l
m
n

j EXECUTE process_batch.sql
k
l
m
n

Objective:
Producing Readable Output with iSQL*Plus

Sub-Objective:
Create and execute script files
Item: 19 (Ref:1z0-007e.2.1.6)

Click the Exhibit(s) button to examine the structure of the LINE_ITEM table.

You attempt to query the database with this SQL statement:

SELECT order_id "Order Number", product_id "Product", quantity "Quantity"


FROM line_item
WHERE Order Number = 5570
ORDER BY "Order Number";

This statement fails when executed. Which change will correct the problem?

j Specify a sort order of ASC or DESC in the ORDER BY clause.


k
l
m
n

j Enclose all of the column aliases in single quotes instead of double quotes.
k
l
m
n

j Remove the column alias from the WHERE clause and use the column name.
k
l
m
n

j Remove the column alias from the ORDER BY clause and use the column name.
k
l
m
n

Objective:
Restricting and Sorting Data

Sub-Objective:
Limit the rows retrieved by a query
Item: 20 (Ref:1z0-007e.1.2.12)

The ITEM table contains these columns:

ITEM_ID NUMBER(9)
COST NUMBER(7,2)
RETAIL NUMBER(7,2)

The RETAIL and COST columns contain values greater than zero.

Copyright © 2010 Self Test Software, Inc. All Rights Reserved


Page 12 of 12
Evaluate these two SQL statements:

1. SELECT item_id, (retail * 1.25) + 5.00 - (cost * 1.10) - (cost * .10) AS Calculated Profit
FROM item;

2. SELECT item_id, retail * 1.25 + 5.00 - cost * 1.10 - cost * .10 "Calculated Profit"
FROM item;

What will be the result?

j Statement 1 will return a higher value than statement 2.


k
l
m
n

j Statement 1 and statement 2 will return the same value.


k
l
m
n

j Statement 1 will display the 'Calculated Profit' column heading.


k
l
m
n

j One of the statements will NOT execute.


k
l
m
n

Objective:
Writing Basic SQL Select Statements

Sub-Objective:
Execute a basic Select statement
Item: 21 (Ref:1z0-007e.7.1.1)

The INVENTORY table contains these columns:

ID_NUMBER NUMBER PK
DESCRIPTION VARCHAR2(30)
SUPPLIER_ID NUMBER

You want to create a query that for each session allows the user to input a value for DESCRIPTION each time the
query runs. While the DESCRIPTION column is stored in upper case, you want the query to retrieve matching
values regardless of the case used when inputting the substitution variable value.

Which SELECT statement should you use?

j SELECT id_number, supplier_id


k
l
m
n
FROM inventory
WHERE description = UPPER(&description);
j SELECT id_number, supplier_id
k
l
m
n
FROM inventory
WHERE LOWER(description) = LOWER('&description');
j SELECT id_number, supplier_id
k
l
m
n
FROM inventory
WHERE LOWER(description) = '&description';
j SELECT id_number, supplier_id
k
l
m
n
FROM inventory
WHERE description = UPPER('&&description');

Objective:
Producing Readable Output with iSQL*Plus

Sub-Objective:
Produce queries that require a substitution variable

Copyright © 2010 Self Test Software, Inc. All Rights Reserved

S-ar putea să vă placă și