izo-007 exam

34
1 Marks: 1 Click the exhibit(s) button to examine the structure of the PRODUCT table. -------------------------------- PRODUCT_ID NUMBER NOT NULL PRODUCT_NAME VARCHAR2(25) SUPPLIER_ID NUMBER NOT NULL LIST_PRICE NUMBER(7,2) COST NUMBER(5,2) QTY_IN_STOCK NUMBER(4) LAST_ORDER_DT DATE DEFAULT SYSDATE NOT NULL Which SELECT statement display the number of items whose LIST_PRICE is greater than $400.00 ? Choose at least one answer. a. SELECT COUNT(*) FROM product ORDER BY list_price; b. SELECT SUM(*) FROM product WHERE list)price > 400; c. SELECT SUM(*) FROM product GROUP BY list_price > 400; d. SELECT COUNT(*) FROM product WHERE list_price > 400; 2 Marks: 1 Click the Exhibit(s) button to examine the structure of the PRODUCT table. PRODUCT_ID NUMBER NOT NULL PRODUCT_NAME VARCHAR2(25) SUPPLIER_ID NUMBER NOT NULL LIST_PRICE NUMBER(7,2) COST NUMBER(5,2) QTY_IN_STOCK NUMBER(4) LAST_ORDER_DT DATE DEFAULT SYSDATE NOT NULL Evaluate this SQL statemnt : SELECT supplier_id, AVG(cost) FROM product WHERE AVG(list_price) > 60.00 GROUP BY supplier_id OREDR BY AVG(cost) DESC; Which clause will cause an error ? Choose one answer. a. SELECT b. WHERE c. ORDER BY

Upload: bimashaktiramadhanutomo

Post on 16-Oct-2015

898 views

Category:

Documents


26 download

DESCRIPTION

IZO-007 exam

TRANSCRIPT

1Marks: 1Click the exhibit(s) button to examine the structure of the PRODUCT table. --------------------------------

PRODUCT_ID NUMBER NOT NULL PRODUCT_NAME VARCHAR2(25) SUPPLIER_ID NUMBER NOT NULL LIST_PRICE NUMBER(7,2) COST NUMBER(5,2) QTY_IN_STOCK NUMBER(4) LAST_ORDER_DT DATE DEFAULT SYSDATE NOT NULL

Which SELECT statement display the number of items whose LIST_PRICE is greater than $400.00 ?Choose at least one answer. a. SELECT COUNT(*) FROM product ORDER BY list_price; b. SELECT SUM(*) FROM product WHERE list)price > 400; c. SELECT SUM(*) FROM product GROUP BY list_price > 400; d. SELECT COUNT(*) FROM product WHERE list_price > 400;

2Marks: 1Click the Exhibit(s) button to examine the structure of the PRODUCT table.

PRODUCT_ID NUMBER NOT NULL PRODUCT_NAME VARCHAR2(25) SUPPLIER_ID NUMBER NOT NULL LIST_PRICE NUMBER(7,2) COST NUMBER(5,2) QTY_IN_STOCK NUMBER(4) LAST_ORDER_DT DATE DEFAULT SYSDATE NOT NULL

Evaluate this SQL statemnt :

SELECT supplier_id, AVG(cost) FROM product WHERE AVG(list_price) > 60.00 GROUP BY supplier_id OREDR BY AVG(cost) DESC; Which clause will cause an error ?Choose one answer. a. SELECT b. WHERE c. ORDER BY d. GROUP BY

3Marks: 1Evaluate this SQL statement: SELECT product_id, product_name, price FROM product WHERE supplier_id IN (SELECT supplier_id FROM product WHERE price > 120 OR qty_in_stock > 100); Which value will be displayed ?Choose one answer. a. The PRODUCT_ID, PRODUCT_NAME, and PRICE of products that are priced greater than $120.00 and have a QTY_IN_STOCK value greater than 100 and have a supplier. b. The PRODUCT_ID, PRODUCT_NAME, and PRICE of products supplied by a supplier with products that are priced greater than $120.00 or with products that have QTY_IN_STOCK value greater than 100. c. The PRODUCT_ID, PRODUCT_NAME, and PRICE of products that are priced greater than $120.00 and have a QTY_IN_STOCK value greater than 100. d. The PRODUCT_ID, PRODUCT_NAME, and PRICE of products that are priced greater than $120.00 or that have a QTY_IN_STOCK value greater than 100.

4Marks: 1Evaluate this SQL*Plus command : COLUMN teacher_name HEADING ?Teacher? FORMAT A25 Which two tasks will this command accomplish ? (Choose two.)Choose at least one answer. a. It will limit the TEACHER_NAME column heading to 25 characters. b. It will display the current settings for the TEACHER_NAME column. c. It will set TEACHER_NAME column heading to ?Teacher?. d. It will center the column heading the TEACHER_NAME column. e. It will set the display width of the TEACHER_NAME column to 25.

5Marks: 1The ACCOUNT table contains these columns : ACCOUNT_ID NUMBER(12) NEW_BALANCE NUMBER(7,2) PREV_BALANCE NUMBER(7,2) FINANCE_BALANCE NUMBER(7,2) With the least amount of effort, you want to display all of the ACCOUNT table records. Which query should you use ?Choose one answer. a. SELECT account_id, new_balance, prev_balance, finance_charge FROM account; b. SELECT any FROM account; c. SELECT all FROM account; d. SELECT * FROM account;

6Marks: 1Click the Exhibit(s) button to examine the structure of the EMPLOYEE table : EMPLOYEE_ID NUMBER, NOT NULL, Primary Key EMP_LNAME VARCHAR2(25) EMP_FNAME VARCHAR2(25) DEPT_ID NUMBER JOB_ID NUMBER MGR_ID NUMBER SALARY NUMBER HIRE_DATE DATE The MGR_ID column currently contains identification numbers, and you need to allow users to include text character in the identification values. Which statement should you use to implement this ?Choose one answer. a. ALTER employee MODIFY(mgr_id VARCHAR2(15)); b. You CANNOT modify the data type of the MGR_ID column c. ALTER TABLE employee MODIFY(mgr_id VARCHAR2(15)); d. ALTER TABLE employee REPLACE(mgr_id VARCHAR2(15)); e. ALTER employee TABLE MODIFY COLUMN(mgr_id VARCHAR2(15));

7Marks: 1Evaluate this statement : TRUNCATE TABLE inventory; Which three users could successfully issue this statement ? (Choose two.)Choose at least one answer. a. any member of the CONNECT and RESOURCE roles b. any user with the DROP ANY TABLE system privilege c. the owner of the INVENTORY table d. any user with the DELETE object privilege on the INVENTORY table e. any user with access to the PUBLIC

8Marks: 1Evaluate this statement SELECT* FROM USER_CONS_COLUMNS; Logged on as user Ann, which task would you accomplish using this stement ?Choose one answer. a. determine the type of constraint on the DEPT_ID column of the DEPARTMENT table in the user Chan schema b. display the names of the constraints on the table you can access c. count the number of UNIQUE constraints in your schema d. display the column associated with the constraint in the table you own

9Marks: 1Examine the structures of the PLAYER and TEAM tables : PLAYER ----------- PLAYAER_ID NUMBER PK LAST_NAME VARCHAR2(30) FIRST_NAME VARCHAR2(25) TEAM_ID NUMBER MGR_ID NUMBER SIGNING_BONUS NUMBER(9,2) TEAM -------- TEAM_ID NUMBER TEAM_NAME VARCHAR2(30) Which two situations would require a subquery to retun the desire result ? (Choose two.)Choose at least one answer. a. a list of all teams that have more than 11 players b. a list of all players that are also managers c. a list of all players who play on the same team with ?John Wilcox? d. a list of all players, including manager name and signing bonus than their manager e. a list of all players who received a signing bonus that was lower than the average

10Marks: 1The LINE_ITEM table contains these columns : LINE_ITEMID NUMBER(9) ORDER_ID NUMBER(9) PRODUCT_ID VARCHAR2(9) QUANTITY NUMBER(5) You created a sequence called LINE_ITEMID_SEQ to generate sequential values for the LINE_ITEMID column. Evaluated this SELECT statement : SELECT line_itemid_seq. CURVAL FROM dual; Which task will this statement accomplish ?Choose one answer. a. increments the LINE_ITEMID column b. display the current value of the LINE_ITEMID_SEQ sequence c. display the next value of the LINE_ITEMID_SEQ sequence d. populates the LINE_ITEMID_SEQ sequence with the next value

11Marks: 1The STUDENT table contains these columns: ID NUMBER(9) LAST_NAME VARCHAR2(25) FIRST_NAME VARCHAR2(25) ENROLL_DATE DATE Evaluate these two statement: 1.SELECT CONCAT(INITCAP(first_name), INITCAP(last_name)) FROM student WHERE enroll_date < ?31-DEC-2002?; 2.SELECT INITCAP(first_name) || INITCAP(last_name) FROM student WHERE enroll_date < ?31-DEC-2002?; Which statement is true ?Choose one answer. a. The two statement will retrieve the same data, but the format of the display will differ. b. The two statement will display the same data. c. The two statement will NOT display the same data. d. One of the statement will fail because it contains a syntax error.

12Marks: 1The PERSONNEL table contains these columns : ID NUMBER(9) LAST_NAME VARCHAR2(25) FIRST_NAME VARCHAR2(25) MANAGER_ID NUMBER(9) DEPT_ID NUMBER(9) Evaluate this SQL statement : SELECT p.dept_id, p.first_name|| ? ? ||p.last_name employee, c.first_name|| ? ? ||c.last_name coworker FROM personnel p, personnel c WHERE p.dept_id = c.dept_id AND p.id c.id; Which result will the statement provide ?Choose one answer. a. It will display each department, the manager in each department, and all employees in each department. b. It will display each employee?s department number, name, and their manager?s name. c. It will return a syntax error. d. It will display each employee?s department number, name, and all their coworkers in the same departement.

13Marks: 1Which clause you use to limit the price value to 100.00 or less ?Choose one answer. a. CONSTRAINT inventory_price_ck CHECK (price < = 100.00) b. CONSTRAINT CHECK inventory_price_ck (price = 50 AND order_id IN(1800, 1900) ORDER BY order_id, product_id; What does the proposed solution provide ?Choose one answer. a. two of the desired results b. all of the desired results c. an error statement d. one of the desired results

34Marks: 1Evaluate this iSQL*Plus command : START process_batch.sql Which iSQL*Plus command will achieve the same results ?Choose one answer. a. GET prcosse_batch.sql b. SAVE prcosse_batch.sql c. EXECUTE prcosse_batch.sql d. &prcosse_batch.sql e. @process_batch.sql

35Marks: 1When executed, which statement display a zero if the PREV_BALANCE value is null and the NEW_BALANCE value is zero ?Choose one answer. a. SELECT IS NULL (.009 * prev_balance, 0) + new_balance ?Current Balance? FROM account; b. SELECT NULL (.009 * prev_balance, 0) + new_balance ?Current Balance? FROM account; c. SELECT TO NUMBER (.009 * prev_balance, 0) + new_balance ?Current Balance? FROM account; d. SELECT NVL (.009 * prev_balance, 0) + new_balance ?Current Balance? FROM account;

36Marks: 1Click the Exhibit(s) button to examine the structure of the PATIENT and PHYSICIAN tables PATIENT ------------ PATIENT_ID NUMBER NOT NULL, Primary Key LAST_NAME VARCHAR2(30) NOT NULL FIRST_NAME VARCHAR2(25) DOB DATE INS_CODE NUMBER PHYSICIAN ---------------- PHYSICIAN_ID NUMBER NOT NULL, Primary Key LAST_NAME VARCHAR2(30) NOT NULL FIRST_NAME VARCHAR2(25) LICENSE_NO NUMBER(7) HIRE_DATE DATE Which join type could be used to produce a report of all patients with physician assigned including patient name and physician name ?Choose one answer. a. the result CANNOT be accomplished because the two tables have no common column b. equijoin c. natural join d. cross join

37Marks: 1Click the Exhibit(s)button to examine the data in the PRODUCT table. ID_NUMBER DESCRIPTION MANUFACTURER_ID QUANTITY COST ------------------- --------------------- ------------------------------ --------------- -------- 215 AAA 6pkbattery NF10032 546 3.00 140 AA 2pk-battery EL7966 2000 603 D 2pk-battery OT456 318 1.10 725 C 2pk-battery OT456 239 .75 218 AAA 6pk-battery OT456 980 3.15 220 AAA 8pk-battery NF10032 4.20 126 AA 2pk-battery NF10032 2513 751 C 2pk-battery EL7968 84 1.00 Evaluate this SELECT statement : SELECT description, cost FROM product ORDDER BY cost, quantity; Which statements are true ? (Choose all that apply.)Choose at least one answer. a. No row with a PRODUCT_ID of 220 is displayed. b. The DESCRIPTION value for the first last two records displayed is ?C 2pk-battery?. c. The PRODUCT_Ids value for the first last two records displayed are 140 and 126. d. The DESCRIPTION value for the first last two records displayed is ?AA 2pk-battery?. e. The PRODUCT_ID value for the first record displayed is 220.

38Marks: 1You issue this statement : CREATE PUBLIC SYNONYM part FOR linda.product; Which task was accomplished by this statement ?Choose one answer. a. A new object privilege was assigned. b. A new system privilege was assigned. c. The need to qualify an object name with its schema was elimated. d. A newsegment object was created.

39Marks: 1How many levels can subqueries be nested in a FROM clause ?Choose one answer. a. 8 b. 16 c. 4 d. 2 e. unlimited

40Marks: 1Which statement pertaining to SQL and iSQL*Plus are true ? (Choose two.)Choose at least one answer. a. SQL runs on a browser. b. SQL includes a continuation character. c. iSQL*Plus can format query results. d. iSQL*Plus can send SQL statement to the server. e. SQL and iSQL*Plus are command languages.

41Marks: 1Evaluate this SQL statement: SELECT line_item_id, order_id, product_id FROM line_item Which WHERE clause should you include to test the QUANTITY column for null value?Choose one answer. a. WHERE quantity IS NULL; b. WHERE quantity = NULL; c. WHERE quantity != NULL; d. WHERE quantity NULL;

42Marks: 1Evaluated this SQL statement : SELECT l.order_id, i.description, l.quantity WHERE i.id_number = l.product_id FROM inventory i, line_item l ORDER BY l.order_id, i.description; The statement fails when executed. Which change will correct the problem?Choose one answer. a. Reorder the clauses in the statement. b. Use the table names instead of the table aliases in the ORDER BY clause. c. Remove the table alias from the ORDER BY clause, and use only the column name. d. Remove the table aliases from the FROM clause.

43Marks: 1The PO_DETAIL table contains these columns : PO_NUM NUMBER NOT NULL Primary Key PO_LINE_ID NUMBER NOT NULL Primary Key PRODUCT_ID NUMBER Foreign Key to PRODUCT_ID column of the PRODUCT table QUANTITY NUMBER UNIT_PRICE NUMBER(5.2) On which column(s) is an index automatically created for the PO_DETAIL table?Choose one answer. a. both PO_NUM and PO_LINE_ID b. PO_NUM only c. PO_LINE_ID only d. UNIT_PRICE only e. PRODUCT_ID only

44Marks: 1The EVENT table constraints these columns : EVENT_ID NUMBER EVENT_NAME VARCHAR2(30) EVENT_DESC VARCHAR2(100) EVENT_TYPE NUMBER LOCATION_ID NUMBER You have been asked tp provide a report of the number of defferent event types at each location. Which SELECT statement will produce the desire result?Choose one answer. a. SELECT UNIQUE(location_id), COUNT(event_type) FROM event GROUP BY lacation_id; b. SELECT COUNT(*), DISTINCT(location_id) FROM event; c. SELECT location_id, COUNT(DISTINCT event_type) FROM event GROUP BY location_id; d. SELECT location_id, MAX(DISTINCTevent_type) FROM event GROUP BY location_id; e. SELECT DISTINCT(event_type) FROM event GROUP BY location_id;

45Marks: 1Seniority is based on the number of years a student has been enrolled at the university. You must create a report that displays each student?s name, id number, and the number of years enrolled. The years enrolled must be rounded to whole number, based on the number of months from the date enrolled until today. Which statement produces the required results ?Choose one answer. a. SELECT first_name||?, ?||last_name ?Student Name?, id ?Id?, enroll_date, TRUNC(SYSDATE,?YY?) ? TRUNC(enroll_date,?YY?) ?Seniority? FROM student; b. SELECT first_name||?, ?||last_name ?Student Name?, id ?Id?, enroll_date, (ROUND(SYSDATE) ? ROUND(enroll_date)) / 12 ?Seniority? FROM student; c. SELECT first_name||?, ?||last_name ?Student Name?, id ?Id?, enroll_date, ROUND(MONTHS_BETWEEN(SYSDATE, enroll_date)/ 12) ?Seniority? FROM student; d. SELECT first_name||?, ?||last_name ?Student Name?, id ?Id?, enroll_date, ROUND(SYSDATE) ? ROUND(enroll_date) ?Seniority? FROM student;

46Marks: 1Click the Exhibit(s) button to examine the structure of the EMPLOYEE and CURR_ORDER tables. EMPLOYEE ---------------- EMPLOYEE_ID NUMBER, NOT NULL, Primary Key EMP_LNAME VARCHAR2(25) EMP_FNAME VARCHAR2(25) DEPT_ID NUMBER JOB_ID NUMBER MGR_ID NUMBER SALARY NUMBER HIRE_DATE DATE CURR_ORDER -------------------- ORDER_ID NUMBER NOT NULL, Primary Key CUSTOMER_ID NUMBER Foreign Key to CUSTOMER_ID column of the CUSTOMER table. EMPLOYEE_ID NUMBER Foreign Key to EMP_ID coumn of the EMPLOYEES table. ORDER_DATE DATE ORDER_AMT NUMBER(7,2) SHIP_METHOD VARCHAR2(5) To keep your top sales representatives motivated, your company plans to increase the commissions of employees. You need to create a SELECT statement that returns the name, commission, and maximum order amount associated with employee for all employees whose commission is less than 8 percent of their maximum order amount. Which SELECT statement should you use ?Choose one answer. a. SELECT e.last_name, e.first_naem, e.commission, MAX(o.order_amount) FROM employee e, curr_order WHERE e.employee_id = o.employee_id AND e.commission < .08 * (SELECT employee_id, MAX(order_amt) MAXAMT FROM curr_order GROUP BY employee_id; b. SELECT e.last_name, e.first_name, e.commision, o.maxamt FROM employee e, (SELECT employee_id, MAX(order_amt) MAXAMT FROM curr_order GROUP BY employee_id) o WHERE e.employee_id = o.employee_id AND e.commision < .08 * maxamt; c. SELECT e.last_name, e.first_name, e.commission, MAX(o.order_amount) MAXAMT FROM employee e, curr_order o WHERE e.employee_id = o.employee_id AND e.commission < .08 * o.maxamt GROUP BY e.last_name, e.first_name, e.commission; d. SELECT last_name, first_name, commision, max_amt FROM employee , (SELECT employee_id, MAX(order_amt) MAXAMT FROM curr_order GROUP BY employee_id) WHERE employee.employee_id = curr_order.employee_id AND commision < .08 * maxamt;

47Marks: 1The TEACHER table contains these columns: ID NUMBER(9) Primary Key LAST_NAME VARCHAR2(25) FIRST_NAME VARCHAR2(25) SUBJECT_ID NUMBER(9) Which query should you use to display only full name of each teacher along with the identification number of the subject they are responsible for teaching ?Choose one answer. a. SELECT last_name, first_name, subject_id FROM teacher; b. SELECT last_name, subject_id FROM teacher; c. SELECT * FROM teacher; d. SELECT last_name, first_name, id FROM teacher;

48Marks: 1Examine the structures of the DEPARTEMENT and ASSET tables : DEPARTEMENT ------------------------ DEPT_ID NUMBER(9) NOT NULL DEPT_ABBR VARCHAR2(4) DEPT_NAME VARCHAR2(25) NOT NULL MGR_ID NUMBER ASSET ---------- ASSET_ID NUMBER(9) NOT NULL ASSET_VALUE FLOAT ASSET_DESCRIPTION VARCHAR2(25) DEPT_ID NUMBER(9) The DEPT_ID column of the ASSET table has a FOREIGN KEY constraint referencing the DEPARTEMENT table. You attempt to update the UPDATE table using this statement : UPDATE asset SET dept_id = (SELECT dept_id FROM departement WHERE dept_name = (SELECT dept_name FROM departement WHERE dept_abbr = ?FINC?)), asset_value = 10000 WHERE asset_id = 2 Which two statements must be true for this UPDATE statement to execute without generating an error? (Choose two)Choose at least one answer. a. Only one row in the DEPARTEMENT table can have a DEPT_NAME value as the DEPT_ABBR of ?FINC?. b. One of subqueries should be removed because subqueries CANNOT be nested c. Only one row in the DEPARTEMENT table can have a DEPT_ABBR value of ?FINC?. d. An asset with an ASSET_ID value of 2 must exist in the ASSET table. e. Both of subqueries used in the UPDATE statement must return one and only one non-null values.

49Marks: 1Which statement concerning SQL function is true ?Choose one answer. a. Single-row function can only be used in SELECT and WHERE clauses. b. Character functions can return character or number values c. Conversion function convert a column definition from one data type to another data type. d. All date function return DATE data type values

50Marks: 1You plan to query data using the TRANS_HIST_V view that was created by another user in their schema. Which statement is true ?Choose one answer. a. The Oracle Server will retrieve the view definition from the ALL_VIEWS data dictionary view. b. The Oracle Server will verify whether you have been granted access pprivileges to the TRANS_HIST_V view. c. The Oracle Server will automatically reset the ARRAYSIZE value so the TRANS_HIST_V query will execute successfully. d. The Oracle Server will retrieve data, detemined by the query criteria, from the TRANS_HIST_V view.

51Marks: 1Which two statement about NOT NULL constraint are true ? (Choose two)Choose at least one answer. a. A NOT NULL constraint is stored in the data dictionary as a UNIQUE constraint. b. You can modify the structure of a NOT NULL constraint using the ALTER TABLE statement. c. NOT NULL constraint can only be defined at the column level. d. You CANNOT define a NOT NULL column if the column does NOT have a non-null value for every row. e. You CANNOT add a NOT NULL constraint to an existing column using the ALTER TABLE statement.

52Marks: 1Which two statements about the evaluation of clause in a SELECT statement are true ? (Choose two).Choose at least one answer. a. The Oracle Server will evaluate a WHERE clause before a GROUP BY clause. b. The Oracle Server will evaluate a GROUP BY clause before a HAVING clause. c. The Oracle Server will evaluate a HAVING clause before a WHERE clause. d. The Oracle Server will evaluate an ORDER BY clause before a HAVING clause. e. The Oracle Server will evaluate an ORDER BY clause before a WHERE clause.

53Marks: 1Click the Exhibit(s) button to examine the data in the WORKORDER table . WO_ID CUST_ID REQIRED_DT COMPL_DT AMOUNT ---------- ------------ ------------------- --------------- -------------- 1 1 04-DEC-2001 02-DEC-01 520.32 2 1 02-JAN-2002 3 2 17-JAN-2002 4 2 20-JAN-2002 05-JAN-2002 274.11 6 3 14-JAN-2002 13-JAN-2002 400.00 7 3 04-FEB-2002 8 4 01-FEB-2002 9 5 14-JAN-2002 The WORKORDER table contains these column: WO_ID NUMBER PK CUST_ID NUMBER REQUIRED_DT DATE COMPL_DT DATE AMOUNT NUMBER(7,2) Which statement regarding the use of aggregate functions on the WORKORDER table is true ?Choose one answer. a. Using the SUM aggregate function on the AMOUNT column will result in erroneous results because the column contains null values. b. Using the SUM aggregate function with the AMOUNT column is allowed in any portion of a statement. c. Using the MIN aggregate function on the COMPL_DT column will return a null value. d. Grouping the REQUIRED_DT and COMPL_DT columns is NOT allowed. e. Using the AVG aggregate function on the AMOUNT column ignores null values. f. Using the AVG aggregate function with any column in the table is allowed.

54Marks: 1Why would you NOT create an index on a column in the CLASS_SCHEDULE table ?Choose one answer. a. to reduce disk I/O b. to speed up queries if the table is small c. to speed up queries that include a foreign key reference to the STUDENT table. d. to speed up row retrieval e. to speed up queries that returned less than 3 percent of the rows.

55Marks: 1Click the exhibit(s) button to examine the data from DONATION table. PLEDGE_ID DONOR_ID PLEDGE_DT AMOUNT_PLEDGED AMOUNT_PAID PAYMENT_DT ----------------- ---------------- ------------------- ----------------------------- --------------------- ------------------- 1 1 10-SEP-2001 1000 1000 02-OCT-2001 2 1 22-FEB-2002 1000 3 2 08-OCT-2001 10 10 28-OCT-2001 4 2 10-DEC-2001 50 5 3 02-NOV-2001 10000 9000 28-DEC-2001 6 3 05-JAN-2002 1000 1000 31-JAN-2001 7 4 09-NOV-2001 2100 2100 15-DEC-2001 8 5 09-DEC-2001 110 110 29-DEC-2001 This statement fails when executed. SELECT amount_pledged, amount_paid FROM donation WHERE donor_id = (SELECT donor_id FORM donation WHERE amount_pledged = 1000.00 OR pledge_dt = ?05-JAN-2002?); Which two changes could correct the problem ? (Choose two.)Choose at least one answer. a. Include the DONOR_ID column in the select list of the outer query. b. Remove the subquery WHERE clause. c. Change the outer query WHERE clause to ?WHERE donor_id LIKE?. d. Remove the single quotes around the date value in the inner query WHERE clause. e. Change the subquery WHERE clause to ?WHERE clause to ?WHERE amount_pledged = 1000.00 AND pledge_dt = ?05-JAN-2002??. f. Change the outer query WHERE clause to ?WHERE donor_id IN?.

56Marks: 1Which of two statements regarding the use of subqueries are true ? (choose two)Choose at least one answer. a. A subquery can be used in the VALUES clause of an INSERT statement, if it returns more than one row. b. A subquery CANNOT be used in the GROUP BY clause of a SELECT statement. c. A subquery used in an INTO clause of a SELECT statement must return only one column, but can return multiple rows. d. A subquery can be used in a CREATE VIEW statement, regardless of the number of rows it returns. e. A subquery can be used in the SET clause of an UPDATE statement, regardless of the number of rows it returns. f. A subquery used with the IN operator must return multiple rows.

57Marks: 1Which SELECT statement will return a numeric value ?Choose one answer. a. SELECT (SYSDATE + enroll_date) + TO_DATE(?29-MAY-02)FROM student; b. SELECT SYSDATE ? enroll_date + TO_DATE(?29-MAY-02?)FROM student; c. SELECT (14 + enroll_date) + 30.5 * 9 FROM student; d. SELECT (SYSDATE ? enroll_date) + 30.5 * 9 FROM student;

58Marks: 1You query the database with this SQL statement : SELECT bonus FROM salary WHERE bonus BETWEEN 1 AND 250 OR (bonus IN(190,500,600) AND bonus BETWEEN 250 AND 500); Which value could the statement return?Choose one answer. a. 400 b. 100 c. 600 d. 260

59Marks: 1Which two statements regarding the valid used of single-row and multiple-row subqueries are true ? (Choose two.)Choose at least one answer. a. Single-row subqueries can only be used in a WHERE clause. b. Multiple-row subqueries can be used with both single-row and multiple-row operators. c. Single-row operators can only be used with single-row subqueries. d. Multiple-row subqueries can be used with the LIKE operator. e. Multiple-row subqueries can be used in a WHERE clause and the INTO portion of an INSERT statement.

60Marks: 1The SERVICE table contains these columns : ID NUMBER PK SERVICE_DATE DATE TECHNICIAN_ID NUMBER DESCRIPTION VARCHAR2(50) Which SELECT statement could you use to display the number of times each technician performed a service between January 1, 2001 and June 20, 2001 ?Choose one answer. a. SELECT COUNT(*) FROM services WHERE service_date bBETWEEN?01-JAN-2001? AND ?30-JUN-2001? GROUP BY service_date; b. SELECT technician_id,service_date,COUNT(*) FROM services WHERE service_date BETWEEN?01-JAN-2001? AND ?30-JUN-2001? ORDER BY technician_id, service_date; c. SELECT COUNT(service_date) FROM services WHERE service_date bBETWEEN?01-JAN-2001? AND ?30-JUN-2001? GROUP BY service_date; d. SELECT technician_id, COUNT(technician_id) FROM services WHERE service_date BETWEEN?01-JAN-2001? AND ?30-JUN-2001? ORDER BY technician_id;

61Marks: 1You disable the PRIMARY KEY constraint on the ID column in the INVENTORY table and updated all the values in the INVENTORY table. You need to enable the constraint and verify that the new ID column values do not violate the constraint. If any of the ID column value do not conform to the constraint, an error message should be returned. Evaluate this statement : ALTER TABLE inventory ENABLE CONSTRAINT inventory_id_pk; Which statement is true ?Choose one answer. a. The statement will achieves the desired results. b. The statement will return a syntax error. c. The statement will execute, but will NOT enable the PRIMARY KEY constraint. d. The statement will execute, but will NOT verify that values in the ID column do NOT violate the constraint.

62Marks: 1Which SELECT statement should you use if you want to display unique combinations of the POSITION and MANAGER values from the EMPLOYEE table ?Choose one answer. a. SELECT position, manager DISTINCT FORM employee; b. SELECT position DISTINCT, manager FORM employee; c. SELECT DISTINCT position, manager FORM employee; d. SELECT position, manager FORM employee;

63Marks: 1Click the Exhibit(s) button to examine the structure of the EVENT and NEW_EVENT tables. EVENT ---------- EVENT_ID NUMBER EVENT_NAME VARCHAR2(30) EVENT_DESC VARCHAR2(100) EVENT_TYPE NUMBER LOCATION_ID NUMBER NEW_EVENT ------------------ EVENT_ID NUMBER EVENT_NAME VARCHAR2(30) EVENT_DESC VARCHAR2(100) EVENT_TYPE NUMBER START_DT DATE You execute this MERGE statement: MERGE INTO EVENT e USING (SELECT * FROM new_event WHERE event_type_id = 4) n ON (e.event_id = n.event_id) WHEN MATCHED THEN UPDATE SET e.event_type_id = n.event_type_id, e.start_dt = n.start_dt WHEN NOT MATCHED THEN INSERT (event_id, event_name, event_type_id) VALUES (n.event_id, n.event_name, n.event_type_id); This MERGE statement generates an error. Which statement describes the cause of the error ?Choose one answer. a. The INSERT portion of the statement is invalid. b. A MERGE statement CANNOT be used with tables that DO NOT have identical structure. c. The UPDATE portion of the statement is invalid. d. A subquery CANNOT be used in the USING clause of the MERGE statement. e. The ON clause of the statement is invalid. f. Table aliases CANNOT be used in a MERGE statement.

64Marks: 1Which three function descriptions are true ? (Choose two.)Choose at least one answer. a. The SYSDATE function returns the host machine date and time. b. The ROUND number function returns a number rounded to the specified column value. c. The NVL single-row function can be used on VARCHAR2 columns. d. The LENGTH charcter function returns the number of charcter in an expression. e. The TRUNC date function returns a date with the time portion of the day truncated to the specified format unit. f. The SUBSTR character function replaces a portion of a string, beginning at a defined character position for a defined length

65Marks: 1You issued this statement : GRANT UPDATE ON inventory TO joe WITH GRANT OPTION; Which task was granted accomplish ?Choose one answer. a. Only a system privilege was granted to user Joe. b. Both an object and a system privilege was granted to user Joe. c. Only an object privilege was granted to user Joe. d. User Joe was granted all privileges on the INVENTORY object.

66Marks: 1You query the database with this SQL statement: SELECT id_number, NVL(100/quantity, 0) FROM product; Which SQL SELECT statement capabilities are achieved when this statement is execute ?Choose one answer. a. projection, selection and joining b. selection and projection only c. projection only d. selection only

67Marks: 1For which would you use the WHERE clause in a SELECT statement ?Choose one answer. a. to compare PRODUCT_ID values to 7382 b. to designate the ORDER table location c. to display only unique PRODUCT_ID values d. to restricted the rows returned by a GROUP BY clause

68Marks: 1For which two condition would you use an equijoin query with the USING keyword ? (Choose two.)Choose at least one answer. a. The PRODUCT and VENDOR tables do NOT have columns with identical names. b. The PRODUCT and VENDOR tables have corresponding columns, but the column in the VENDOR table contains null values taht need to displayed. c. You want to perform a natural join of the PRODUCT and VENDOR tables but limit the number of columns in the join condition. d. The PRODUCT table contains a columns that references another column in the PRODUCT table. e. The PRODUCT and VENDOR tables have corresponding columns, but the column in the PRODUCT table contains null values taht need to displayed. f. The PRODUCT and VENDOR tables have columns with identical names.

69Marks: 1Which statement about sequence is true ?Choose one answer. a. Creating a sequence causes sequence numbers are stired in a table. b. A sequence slows down the efficiency of accessing sequence values cached in memory. c. A sequence can only be used to create a primary key value. d. One sequence can be used for multiple table in the same schema.

70Marks: 1User Dave cannot remember his password and would like to create a new one:?dave500?. He is not currently connected to the Oracle Server. User Dave has only been granted the CREATE SESSION system privilege. Which statement should he execute ?Choose one answer. a. User Dave CANNOT change his password. b. ALTER USER dave NEW PASSWORD dave500; c. ALTER USER dave IDENTIFIED BY NEW PASSWORD dave500; d. ALTER USER dave IDENTIFIED BY PASSWORD dave500; e. ALTER USER dave IDENTIFIED BY dave500;

71Marks: 1With which three constructs could a view be created that would prevent a user from deleting rows in the base table on which the view is based ?Choose at least one answer. a. group function b. DISTINCT keyword c. inline view d. subquery e. GROUP BY clause

72Marks: 1Which SQL SELECT statement clause is an example of the selection capability, but not the joining capability ?Choose one answer. a. SELECT id_number, description, cost b. WHERE d.deptno = 10 c. SELECT * d. WHERE d.deptno = e.deptno

73Marks: 1The ACCOUNT table contains these columns: ACCOUNT_ID NUMBER(12) NEW_BALANCE NUMBER(7,2) PREV_BALANCE NUMBER(7,2) PAYMENT NUMBER(7,2) FINANCE_CHARGE NUMBER(7,2) CREDIT_LIMIT NUMBER(7) You execute this statement: SELECT ROWNUM ?Rank?, account_id, finance_charge FROM (SELECT account_id, finance_charge FROM account ORDER BY finance_charge DESC) WHERE ROWNUM = 300 GROUP BY customer_id; Which statement using the ORDER_HIST_V view will execute successfully ?Choose one answer. a. INSERT INTO order_hist_v (order_id, customer_id, emp_id, order_dt) VALUES(8456, 292, 104, ?10-OCT-2001?); b. DELETE FROM order_hist_v WHERE customer_id = 794; c. SELECT * FROM order_hist_v; d. UPDATE order_hist_v SET emp_id = 389 WHERE emp_id = 5423 AND order_amt