You are on page 1of 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 d e f g FROM MAX(order_dt) c d e f g SELECT SUM(order_dt) c d e f g SELECT SUM(order_amount) c d e f g SELECT MAX(AVG(order_amount)) c d e f g WHERE MIN(order_amount) = order_amount c d e f g SELECT location_id, order_dt, MAX(order_amount)

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 d e f g The PRODUCT_ID value for the first record displayed is 220. c d e f g The PRODUCT_IDs value for the last two records displayed are 140 and 126. c d e f g The DESCRIPTION value for the first two records displayed is 'C 2pk-battery'. c d e f g The DESCRIPTION value for the first two records displayed is 'AA 2pk-battery'. c d e f g No row with a PRODUCT_ID of 220 is displayed.

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

FROM style JOIN product USING (style_id).1. product_id Copyright © 2010 Self Test Software. All Rights Reserved . FROM product CROSS JOIN style. c d e f g SELECT style_id. product_id c d e f g SELECT style_id. Which three queries could you use? (Choose three. FROM product NATURAL JOIN style. product_id FROM style JOIN product ON style_id = product_id.) c d e f g SELECT style_id. Inc. c d e f g SELECT style_id. product_id c d e f g SELECT style_id.Page 2 of 12 Objective: Restricting and Sorting Data Sub-Objective: Sort the rows retrieved by a query Item: 3 (Ref:1z0-007e.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. product_id FROM product CROSS JOIN style ON (style_id = product_id).4.

po_total c d e f g SELECT p.po_num.po_date. p. s. supplier s WHERE p. p. po_total FROM po_header NATURAL JOIN supplier.po_date. supplier_name. FROM po_header p JOIN supplier s USING (supplier_id). p. p. s. All Rights Reserved .3) Click the Exhibit(s) button to examine the structures of the PO_HEADER and SUPPLIER tables. s.po_date.supplier_id = s.po_num. c d e f g SELECT p.) c d e f g SELECT p.po_num.supplier_id).supplier_name.po_total c d e f g SELECT p.4. po_date.po_num.supplier_name.supplier_id.po_total FROM po_header p NATURAL JOIN supplier s USING (supplier_id).1. Which two SQL statements will produce identical results? (Choose two.po_date. p. 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.Page 3 of 12 c d e f g SELECT style_id. product_id FROM style. FROM po_header p JOIN supplier s USING (p. p.supplier_id = s. Inc. product.supplier_name. c d e f g SELECT po_num. 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.supplier_id). Evaluate this SQL statement: SELECT p.po_date.supplier_name. s.po_num. p. p. p.supplier_name.po_total FROM po_header p.po_total FROM po_header p JOIN supplier s USING (p. p. s.

c d e f g Single. c d e f g A date value may be converted to a character string using the TO_CHAR function. c d e f g Single-row operators can only be used with single-row subqueries. c d e f g A number value may be converted to a character string using the TO_CHAR function.4) Examine the structures of the BOOK and PUBLISHER tables: Copyright © 2010 Self Test Software.Page 4 of 12 Item: 5 (Ref:1z0-007e. c d e f g A character value may be converted to a date value using the TO_DATE function.3.3.8) Which three statements concerning explicit data type conversions are true.3.3.) c d e f g A number value may be converted to a date value using the TO_DATE function. (Choose three.6. c d e f g A number value may be converted to a character value using the TO_NUMBER function.and multiple-row subqueries can be used with the BETWEEN operator. c d e f g Multiple-row subqueries can be used with both single-row and multiple-row operators.6. Objective: Single-Row Functions Sub-Objective: Use conversion functions Item: 6 (Ref:1z0-007e.3) Which two statements regarding the valid use of single-row and multiple-row subqueries are true? (Choose two. Inc. c d e f g Multiple-row subqueries can be used in a WHERE clause and the INTO portion of an INSERT statement. Objective: Subqueries Sub-Objective: List the types of subqueries Item: 7 (Ref:1z0-007e. c d e f g A date value may be converted to a character value using the TO_DATE function. c d e f g A date value may be converted to a number value using the TO_NUMBER function. All Rights Reserved . c d e f g Multiple-row subqueries can be used with the LIKE operator.) c d e f g Single-row subqueries can only be used in a WHERE clause.

id = b.) c d e f g UPDATE book SET price = price * 2 WHERE publisher_id IN (SELECT id FROM publisher WHERE UPPER(location) = 'BOSTON'). cost c d e f g SELECT book_name.4. cost Objective: Subqueries Sub-Objective: List the types of subqueries Item: 8 (Ref:1z0-007e. SET price = price * 2 WHERE publisher_id = (SELECT id FROM publisher WHERE UPPER(location) = 'BOSTON').publisher_id)). price c d e f g SELECT book_name. price. Inc. c d e f g UPDATE book c d e f g SELECT book_name. FROM book WHERE publisher_id IN (SELECT id FROM publisher p JOIN book b ON (p.1. location.Page 5 of 12 BOOK ---------BOOK_ID VARCHAR2(25) PK BOOK_NAME VARCHAR2(50) PUBLISHER_ID NUMBER COST NUMBER(5.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. price. FROM book WHERE publisher_id = (SELECT id FROM publisher WHERE LOWER(name) = 'master press').2) PUBLISHER -------------------ID NUMBER PK NAME VARCHAR2(30) LOCATION VARCHAR2(20) Which two SQL statements correctly use subqueries? (Choose two. FROM book WHERE publisher_id IN (SELECT id FROM publisher WHERE id = 54). All Rights Reserved .2) PRICE NUMBER(5.

Copyright © 2010 Self Test Software. All Rights Reserved . c d e f g SELECT product_name. c d e f g The Oracle Server will evaluate an ORDER BY clause before a WHERE clause.product_name.supplier_id = s.supplier_id ORDER BY p. s. c d e f g The Oracle Server will evaluate a GROUP BY clause before a HAVING clause.Page 6 of 12 UNIT_PRICE NUMBER(7. FROM product p JOIN supplier s ON (supplier_id) ORDER BY p. FROM product NATURAL JOIN supplier ORDER BY product_name.supplier_name FROM product p LEFT OUTER JOIN supplier s ON p. Inc.product_name. Only products in the PRODUCT table that have a supplier assigned should be included in your report.supplier_id) ORDER BY p.) c d e f g The Oracle Server will evaluate a HAVING clause before a WHERE clause. c d e f g The Oracle Server will evaluate a WHERE clause before a GROUP BY clause.5.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. supplier_name c d e f g SELECT p.supplier_name c d e f g SELECT product_name.product_name.product_name.4.) c d e f g SELECT p. The Oracle Server will evaluate an ORDER BY clause before a HAVING clause.3) Which two statements about the evaluation of clauses in a SELECT statement are true? (Choose two. s. FROM product JOIN supplier USING (supplier_id) ORDER BY product_name.product_name. c d e f g SELECT p.supplier_name FROM product p JOIN supplier s USING (p. s. Which two queries could you use? (Choose two. supplier_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.product_name.

Objective: Writing Basic SQL Select Statements Sub-Objective: Differentiate between SQL statements and iSQL*Plus commands Item: 11 (Ref:1z0-007e. Inc.6. c d e f g iSQL*Plus can send SQL statements to the server.) c d e f g SQL runs on a browser. regardless of the number of rows it returns.) c d e f g A subquery used with the IN operator must return multiple rows. but can return multiple rows.1. c d e f g A subquery can be used in the SET clause of an UPDATE statement. c d e f g iSQL*Plus can format query results. c d e f g A subquery can be used in a CREATE VIEW statement. if it returns more than one row. c d e f g SQL and iSQL*Plus are command languages. c d e f g SQL includes a continuation character. c d e f g A subquery used in an INTO clause of a SELECT statement must return only one column. c d e f g A subquery can be used in the VALUES clause of an INSERT statement.1) Which of two statements regarding the use of subqueries are true? (Choose two. regardless of the number of rows it returns.1.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. c d e f g A subquery CANNOT be used in the GROUP BY clause of a SELECT statement. All Rights Reserved .2.3. Objective: Subqueries Sub-Objective: Define subqueries Item: 12 (Ref:1z0-007e.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.3) Which statements pertaining to SQL and iSQL*Plus are true? (Choose all that apply.

c d e f g Separate column aliases are used for the LAST_NAME.1) Evaluate this SQL*Plus command: Copyright © 2010 Self Test Software.7. and date column values? (Choose three. Click the Exhibit(s) button to examine the output.1. Which two statements concerning this report's SELECT statement are true? (Choose two. and ENROLL_DATE columns.4) Which three functions can be used to manipulate character. number. c d e f g The display lengths of the LAST_NAME and FIRST_NAME columns are increased.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. FIRST_NAME. c d e f g One column alias is used for the LAST_NAME and FIRST_NAME columns. c d e f g The LAST_NAME and FIRST_NAME columns are concatenated together. All Rights Reserved .3.2. Objective: Writing Basic SQL Select Statements Sub-Objective: Execute a basic Select statement Item: 13 (Ref:1z0-007e.) c d e f g RPAD c d e f g TRUNC c d e f g ROUND c d e f g INSTR c d e f g CONCAT Objective: Single-Row Functions Sub-Objective: Describe various types of functions available in SQL Item: 14 (Ref:1z0-007e. Inc.) c d e f g A format mask must have been used on the ENROLL_DATE column.

) c d e f g The SYSDATE function returns the host machine date and time.1. Inc. including the total value of the orders.Page 9 of 12 COLUMN teacher_name HEADING 'Teacher' FORMAT A25 Which two tasks will this command accomplish? (Choose two. Objective: Single-Row Functions Sub-Objective: Describe various types of functions available in SQL Item: 16 (Ref:1z0-007e. beginning at a defined character position for a defined length.1) Which three function descriptions are true? (Choose three.) c d e f g SUM c d e f g STOT c d e f g TSUM c d e f g VALUE c d e f g COUNT c d e f g STDDEV Copyright © 2010 Self Test Software. c d e f g It will display the current settings for the TEACHER_NAME column. c d e f g It will limit the TEACHER_NAME column heading to 25 characters. All Rights Reserved . c d e f g The SUBSTR character function replaces a portion of a string. c d e f g The NVL single-row function can be used on VARCHAR2 columns. c d e f g The ROUND number function returns a number rounded to the specified column value.3. c d e f g The LENGTH character function returns the number of characters in an expression.1. Objective: Producing Readable Output with iSQL*Plus Sub-Objective: Produce more readable output Item: 15 (Ref:1z0-007e.5. Which two aggregate functions should you use in your SQL statement? (Choose two.2) You want to produce a report containing the total number of orders placed for a particular time period. c d e f g It will set the display width of the TEACHER_NAME column to 25.) c d e f g It will set the TEACHER_NAME column heading to 'Teacher'. c d e f g The TRUNC date function returns a date with the time portion of the day truncated to the specified format unit. c d e f g It will center the column heading of the TEACHER_NAME column.

All Rights Reserved .1. 1900) ORDER BY order_id.2. product_id. quantity FROM line_item WHERE quantity >= 50 AND order_id IN(1800. The volume of the item ordered must be 50 or greater. The display must be sorted from the lowest to the highest by order number and then by product number.sql Copyright © 2010 Self Test Software.1) Evaluate this iSQL*Plus command: START process_batch.3. 3. The items must belong to order numbers ranging from 1800 to 1900. Evaluate this SQL script: SELECT order_id. What does the proposed solution provide? j k l m n one of the desired results j k l m n two of the desired results j k l m n all of the desired results j k l m n an error statement Objective: Restricting and Sorting Data Sub-Objective: Limit the rows retrieved by a query Item: 18 (Ref:1z0-007e.Page 10 of 12 Objective: Aggregating Data using Group Functions Sub-Objective: Identify the available group functions Item: 17 (Ref:1z0-007e. You want to display order id numbers. product id numbers.7. 2.sql Which iSQL*Plus command will achieve the same results? j k l m n &process_batch.7) Click the Exhibit(s) button to examine the structure of the LINE_ITEM table. and the quantity of the product ordered with these desired results: 1. Inc. product_id.

2) RETAIL NUMBER(7. j k l m n Enclose all of the column aliases in single quotes instead of double quotes.sql Objective: Producing Readable Output with iSQL*Plus Sub-Objective: Create and execute script files Item: 19 (Ref:1z0-007e.2.Page 11 of 12 j k l m n @ process_batch.2.sql j k l m n GET process_batch. quantity "Quantity" FROM line_item WHERE Order Number = 5570 ORDER BY "Order Number". All Rights Reserved . Which change will correct the problem? j k l m n Specify a sort order of ASC or DESC in the ORDER BY clause. j k l m n Remove the column alias from the WHERE clause and use the column name. product_id "Product".2) The RETAIL and COST columns contain values greater than zero.1.sql j k l m n SAVE process_batch. j k l m n Remove the column alias from the ORDER BY clause and use the column name. You attempt to query the database with this SQL statement: SELECT order_id "Order Number".1. Inc.12) The ITEM table contains these columns: ITEM_ID NUMBER(9) COST NUMBER(7. Copyright © 2010 Self Test Software.sql j k l m n EXECUTE process_batch. This statement fails when executed. Objective: Restricting and Sorting Data Sub-Objective: Limit the rows retrieved by a query Item: 20 (Ref:1z0-007e.6) Click the Exhibit(s) button to examine the structure of the LINE_ITEM table.

SELECT item_id. FROM inventory WHERE LOWER(description) = LOWER('&description'). 2. All Rights Reserved .00 . Inc.1. While the DESCRIPTION column is stored in upper case.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. Which SELECT statement should you use? j k l m n SELECT id_number.(cost * 1. you want the query to retrieve matching values regardless of the case used when inputting the substitution variable value.10) .25 + 5.00 .7. What will be the result? j k l m n Statement 1 will return a higher value than statement 2. FROM inventory WHERE description = UPPER('&&description'). j k l m n Statement 1 and statement 2 will return the same value.25) + 5. j k l m n One of the statements will NOT execute.10 . Objective: Producing Readable Output with iSQL*Plus Sub-Objective: Produce queries that require a substitution variable Copyright © 2010 Self Test Software.(cost * . supplier_id j k l m n SELECT id_number. Objective: Writing Basic SQL Select Statements Sub-Objective: Execute a basic Select statement Item: 21 (Ref:1z0-007e.10) AS Calculated Profit FROM item. supplier_id j k l m n SELECT id_number. supplier_id j k l m n SELECT id_number.Page 12 of 12 Evaluate these two SQL statements: 1.cost * .10 "Calculated Profit" FROM item. supplier_id FROM inventory WHERE description = UPPER(&description). SELECT item_id. j k l m n Statement 1 will display the 'Calculated Profit' column heading. (retail * 1. retail * 1. FROM inventory WHERE LOWER(description) = '&description'.cost * 1.