You are on page 1of 35

1 Marks: 1 The PRODUCT table contains these columns : 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 INSERT statement will execute successfully ? Choose one answer. a. INSERT INTO product VALUES (10,?Ladder-back Chair?, 5, 59.99, 37.32, 10000, DEFAULT); b. INSERT INTO product VALUES (10,?Ladder-back Chair?, NULL, NULL, NULL, NULL, DEFAULT); c. INSERT INTO product(product_id, supplier_id, list_price, cost, last_order_dt) VALUES (10, 5, 69.99); d. INSERT INTO product(product_id, product_name, supplier_id, list_price, cost, last_order_dt) VALUES (&prod_id,?&desc?, &supplier, & list, &cost, DEFAULT); e. INSERT INTO product VALUES (10,?Ladder-back Chair?, 5, 59.99, 37.32, 1000, 10-JAN-02); 2 Marks: 1 The ACCOUNT table contains these columns : ACCOUNT_ID NUMBER(12) NEW_BALANCE NUMBER(7,2) PREV_BALANCE NUMBER(7,2) FINANCE_CHARGE NUMBER(7,2) CREDIT_LIMIT NUMBER(7,2) You created a Top-n query report for the Marketing Departement that displays the account numbers and new balance of the 1500 accounts that have the lowest new balance. The results are sorted by the new balance from lowest to highest. Which two SELECT statements clauses are included in your query ? (Choose two.) Choose at least one answer. a. outer query: SELECT account_id ?Account?, new_balance ?Current Bal?, ROWNUM ?Rank? b. outer query: ORDER BY new_balance < = 1500 c. inner query: WHERE ROWNUM < = 1500 d. inner query: ORDER BY new_balance e. inner query: SELECT account_id, new_balance ROWNUM 3 Marks: 1 Evaluate this SELECT statement: SELECT first_name, last_name FROM physician WHERE physician _id NOT IN (SELECT physician_id FROM physician WHERE license_no = 17852); Which SELECT statement would achieve the same result ? Choose one answer. a. SELECT first_name, last_name FROM physician WHERE physician _id != (SELECT physician_id FROM physician WHERE license_no = 17852); b. SELECT first_name, last_name FROM physician WHERE license_no <>

17852 AND license_no IS NOT NULL; c. SELECT first_name, last_name FROM physician WHERE physician _id IN (SELECT physician_id FROM physician WHERE license_no = 17852); d. SELECT first_name, last_name FROM physician WHERE license_no = 17852; 4 Marks: 1 Click 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 8pkbattery 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 PRODUCT_Ids value for the first last two records displayed are 140 and 126. c. The PRODUCT_ID value for the first record displayed is 220. d. The DESCRIPTION value for the first last two records displayed is ?C 2pkbattery?. e. The DESCRIPTION value for the first last two records displayed is ?AA 2pkbattery?. 5 Marks: 1 You want to create a view that when queried will display the name, customer identification number, new balance, finanace charge, and credit limit of all customer. When queried, the display should be sorted by credit limit from highest to lowest, then by last name alphabetically. The view definition should be created regardless of the existence of the CUSTOMER or ACCOUNT tables. No DML may be performed when using this view. Evaluate these statements : CREATE OR REPLACE FORCE VIEW CUST_CREDIT_V AS SELECT c.last_name, c.first_name, c.customer_id..., a.new_balance, a.finance_charge, a.credit_limit FROM customer c, account a WHERE c.account_id = a.account_id WITH READ ONLY; SELECT * FROM cust_credit_c ORDER BY credit_limit DESC, last_name; Which statement is true ? Choose one answer. a. The statement will NOT return all of the desired results because the WITH CHECK OPTION clause is NOT included in the CREATE VIEW statement. b. To achieve all of the desired results this ORDER BY clause shoul be added to the CREATE VIEW statement: ? ORDER BY credit_limit DESC, c.last_name?. c. When both statement are execute all of the desired results are archieved. d. The CREATE VIEW statement will fail because a view may NOT be created on tables that do NOT exist or are NOT accessible by the user.

6 Marks: 1 How many values could a subquery used with the <> operator return ? Choose one answer. a. up to 2 b. only 1 c. unlimited d. up to 10 7 Marks: 1 Evaluate this CREATE TABLE statement: CREATE TABLE customer ( customer_id NUMBER, company_name VARCHAR2(30), contact_name VARCHAR2(30), contact_title VARCHAR2(30), address VARCHAR2(30), city VARCHAR2(25), region VARCHAR2(10), postal_code VARCHAR2(20), country _id NUMBER DEFAULT 25, phone VARCHAR2(20), fax VARCHAR2(20), credit_limit NUMBER(7,2); Which three business requirements will this statement accomplish ? (Choose two) Choose at least one answer. a. Credit limit values can be up to $1.000.000. b. All customer identification values are only 6 digits so the column should be fixed in leght. c. Phone number values can range from 7 to 20 character so the column should be variable in leght. d. The value 25 should be used if no values is provided for the country identification when a record is inserted. e. Company identification values could be either numbers or characters or a combination of both. 8 Marks: 1 Which statement will user Barbara use to create a private synonym when referencing the EMPLOYEE table exixting in user Chan?s schema ? Choose one answer. a. CREATE SYNONYM emp FROM chan.employee; b. CREATE PUBLIC emp SYNONYM FROM chan.employee; c. CREATE PRIVATE SYNONYM emp FROM chan.employee; d. CREATE PUBLIC SYNONYM emp FROM chan.barbara; 9 Marks: 1 With 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 BY clause b. group function c. inline view d. DISTINCT keyword e. subquery 10 Marks: 1 Which statement pertaining to SQL and iSQL*Plus are true ? (Choose two.) Choose at least one answer. a. iSQL*Plus can send SQL statement to the server. b. SQL includes a continuation character. c. iSQL*Plus can format query results. d. SQL runs on a browser. e. SQL and iSQL*Plus are command languages.

11 Marks: 1 Which two statement would cause an implicit COMMIT to occur ? (Choose two) Choose at least one answer. a. UPDATE b. ROLLBACK c. COMMIT d. SELECT e. RENAME f. GRANT 12 Marks: 1 Evaluatr this statement : TRUNCATE TABLE inventory; Which two statements about this TRUNCATE TABLE statement are true ? (Choose two.) Choose at least one answer. a. You must be the owner of the INVENTORY table to issue this statement successfully. b. This statement will produce the same result as the ?DROP TABLE inventory? statement.

c. The statement will produce the same result as the ?DELETE inventory? statement. d. The statement will permanently remove all the rows from the INVENTORY table. e. The result of this statement can be reserved by issuing a ROLLBACK. f. The statement will retain the structure of the INVENTORY table. 13 Marks: 1 Evaluated 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. Use the table names instead of the table aliases in the ORDER BY clause. b. Remove the table alias from the ORDER BY clause, and use only the column name. c. Remove the table aliases from the FROM clause. d. Reorder the clauses in the statement. 14 Marks: 1 The 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. One of the statement will fail because it contains a syntax error. b. The two statement will retrieve the same data, but the format of the display will differ. c. The two statement will NOT display the same data. d. The two statement will display the same data. 15 Marks: 1 The 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. populates the LINE_ITEMID_SEQ sequence with the next value d. display the next value of the LINE_ITEMID_SEQ sequence 16 Marks: 1 For which column woulmn you create an index ? Choose one answer. a. a column containing a wide range of values b. a column that is updated frequently c. a column with a small number of null values d. a column that is small 17 Marks: 1 You issue this CREATE TABLE statement : CREATE TABLE transaction ( Transaction_id NUMBER(9), Transaction_code NUMBER(5), Cust_account VARCHAR2(12)); Which statement or command will execute with no results if you issue it immediately after this CREATE TABLE statement ? Choose one answer. a. ROLLBACK; b. DESCRIPTION transaction; c. CREATE TABLE transaction2 AS SELECT * FROM transaction; d. DROP TABLE transaction; 18 Marks: 1 Examine 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. Both of subqueries used in the UPDATE statement must return one and only one non-null values. c. One of subqueries should be removed because subqueries CANNOT be nested d. An asset with an ASSET_ID value of 2 must exist in the ASSET table. e. Only one row in the DEPARTEMENT table can have a DEPT_ABBR value of ?FINC?. 19 Marks: 1 Which two operators can be used in an outer join condition ? (choose two) Choose at least one answer. a. OR b. AND c. = d. IN 20 Marks: 1 Click 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 TABLE employee MODIFY(mgr_id VARCHAR2(15)); b. You CANNOT modify the data type of the MGR_ID column c. ALTER TABLE employee REPLACE(mgr_id VARCHAR2(15)); d. ALTER employee MODIFY(mgr_id VARCHAR2(15)); e. ALTER employee TABLE MODIFY COLUMN(mgr_id VARCHAR2(15));

21 Marks: 1 Which 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 LENGTH charcter function returns the number of charcter in an expression.

c. The ROUND number function returns a number rounded to the specified column value. d. The TRUNC date function returns a date with the time portion of the day truncated to the specified format unit. e. The NVL single-row function can be used on VARCHAR2 columns. f. The SUBSTR character function replaces a portion of a string, beginning at a defined character position for a defined length 22 Marks: 1 Which SQL SELECT statement performs a projection, a selection, and join when executed ? Choose one answer. a. SELECT id_number, manufacturer_id FROM product ORDER BY manufacturer_id. id_number; b. SELECT manufactuere_id, cityy FROM manufacturer AND manufacturer_id = 'NF 10032' ORDER BY city; SELECT manufactuere_id, cityy FROM manufacturer AND manufacturer_id = 'NF 10032' ORDER BY city; c. SELECT id_number, manufacturer_id FROM product WHERE manufacturer_id = 'NF 10032'; d. SELECT p.id_number, m.manufacturer_id. m.city FROM product p. manufacturer m WHERE p manufaclurer_id = m.manufacturer_id AND m manufacturer_id = 'NF10032'; 23 Marks: 1 Evaluate this statement : CREATE SEQUENCE line_item_id_seq START WITH 10001 MAXVALUE 999999999 NOCYCLE; Which statement about this CREATE SEQUENCE statement is true ? Choose one answer. a. The sequence will continue to generate value after it reaches its maximum value. b. The sequence will never reuse any numbers and will increment by 1. c. The CREATE SEQUENCE statement will cause a syntax error because an INCREMENT BY value is included. d. The sequence will reuse numbers and will start with 10001. 24 Marks: 1 The SUPPLIER table constraints 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.) Choose at least one answer. a. SELECT SUM(order_dt)

b. SELECT MAX(AVG(order_amount)) c. WHERE MIN(order_amount) = order_amount d. SELECT SUM(order_amount) e. SELECT location_id, order_dt, MAX(order_amount) f. FROM MAX(order_dt) 25 Marks: 1 The TEACHER table in your schema contains these columns : ID NUMBER(9) NOT NULL, Primary Key LAST_NAME VARCHAR2(25) FIRST_NAME VARCHAR2(25) SUBJECT_ID NUMBER(9) You execute this statement : CREATE INDEX teacher_name-idx ON teacher(first_name,last_name); Which statement is true ? Choose one answer. a. The statement will fail because it contains a syntax error. b. You must have the CREATE ANY INDEX privilege for this statement to succeed. c. The statement creates a composite unique index. d. The statement creates a composite non-unique index 26 Marks: 1 Which 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. SELECT * c. WHERE d.deptno = e.deptno d. WHERE d.deptno = 10 27 Marks: 1 Which statements concerning the creation of a view are true? (Choose all that apply.) Choose at least one answer. a. View columns that are the result of the derived must be given a column alias. b. A constraint name must be provided when using the WITH CHECK OPTION clause or the statement will fail. c. A view may have column names that are different than the actual base table(s) column names by using column aliases. d. When the view already exist, using the OR REPLACE option requires the regranting of the object privileges previously.

28 Marks: 1 You are creating the SALES table. This table should contain the SALE_DATE column and use the current data if no date is providd when a record is inserted. Which line should you include in the CREATE TABLE statement to accomplish this task? Choose one answer. a. sale_date DATE SYSDATE b. sale_date DATE DEFAULT c. sale_date DATE = SYSDATE d. sale_date DATE = (SELECT * FROM DUAL) e. sale_date DATE DEFAULT SYSDATE 29 Marks: 1 For which two type of constraints will a unique index be automatically created ? (Choose two) Choose at least one answer. a. FOREGN KEY b. CHECK c. PRIMARY KEY d. UNIQUE e. NOT NULL 30 Marks: 1 You want to query employee information and display the result sorted by the employee?s department, then by their salaries from highest to lowest. When multiple employees within the same department share a last name, they must be displayed in alphabetical order by first name. Which ORDER BY clause should you use in your query ? Choose one answer. a. ORDER BY department_id, salary ASC, last_name, first_name b. ORDER BY department_id, salary DESC, first_name ||? ?||last_name ASC c. ORDER BY department_id, salary, last_name, first_name d. ORDER BY department_id, salary DESC, last_name, first_name

31 Marks: 1 Which 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 FORM employee; b. SELECT position, manager DISTINCT FORM employee; c. SELECT DISTINCT position, manager FORM employee; d. SELECT position DISTINCT, manager FORM employee; 32 Marks: 1 The 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 employee?s department number, name, and all their coworkers in the same departement. b. It will display each department, the manager in each department, and all employees in each department. c. It will display each employee?s department number, name, and their manager?s name. d. It will return a syntax error. 33 Marks: 1 In which clauses of a SELECT statement can be substitution variables be used ? Choose one answer. a. he SELECT, FROM, WHERE, GROUP BY, ORDER BY, and HAVING clauses b. the SELECT, WHERE, GROUP BY, and ORDER BY clauses, but NOT the FROM clause c. the SELECT and FROM clauses, but NOT the WHERE clauses d. the SELECT, FROM, WHERE, GROUP BY< ORDER BY , and HAVING clauses e. the SELECT, FROM, and WHERE clauses only 34 Marks: 1 Which arithmetic operation will return a numeric value ? Choose one answer. a. ?17-JUN-1999? * (480/24) b. ?14-FEB-2002? + 25

c. TO_DATE(?01-JAN_2001?) ? TO_DATE(?01-DEC-2000?) d. ?03-JAN-200? - 30 35 Marks: 1 Which 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 operators can only be used with single-row subqueries. b. Multiple-row subqueries can be used with both single-row and multiple-row operators. c. Multiple-row subqueries can be used with the LIKE operator. d. Single-row subqueries can only be used in a WHERE clause. e. Multiple-row subqueries can be used in a WHERE clause and the INTO portion of an INSERT statement. 36 Marks: 1 Click 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) You queried the database with this SQL statement: SELECT a.last_name, a.first_name, a.job_id, NVL(a.commission,0), b.avgcomm FROM employee a (SELECT job_id, AVG(commission) AVGCOMM FROM employee WHERE commission IS NOT NULL GROUP BY jon_id)b WHERE a.job_id = b.job_id AND a.commission < b.avgcomm; Which is a result of this query ? Choose one answer. a. The employee information displayed will be displayed in numeric order by the JOB_ID and in alphabetical order by the LAST_NAME where the JOB_IDs are the same. b. The employee information displayed will be for employees that have a commission that is less than the average commission of all employee who have the same job. c. A self join CANNOT be used in an outer query when the inner query is an inline view. The self join must be placed in the inner query for the statement to execute successfully. d. he AVG function?s DISTINCT keyword must be used in the inner query or the statement will fail when executed. 37

Marks: 1 Click the Exhibit(s) button to examine the structure of the LINE_ITEM table. PRODUCT_ID QUANTITY ORDER_IT LINE_ITEM_ID -------------------- --------------- -------------- --------------------- A-2356 7 1494 2 Z-79 5 1494 3 A-7849 18 1533 3 LINE_ITEM_ID ORDER_ID PRODUCT_ID QUANTITY --------------------- --------------- ------------------- ---------------- 2 1494 A-2356 7 3 1533 A-7849 18 6 1589 C-589 33 1 1533 A-3209 100 2 1533 A-3210 1 4 1494 Z-78 1 10 1588 C-555 250 3 1494 Z-79 5 Evaluate this SQL statement : SELECT product_id, quantity FROM line_item WHERE quantity BETWEEN 5 AND 30 ORDER BY order_id.line_item_id Which PRODUCT_ID would be displayed last ? Choose one answer. a. A-7849 b. A-2356 c. C-555 d. Z-79 38 Marks: 1 Eri is working in a database server, which has been recently configured for a shared server environment. Upon analysis, he realize that there has been an increase in memory demands for the SGA component for the SGA component because some memory structures are now accommodated int th SGA. Which component of the SGA should be allocated more memory to ensure that the new memory demands are met ? Choose one answer. a. database buffer cache b. shared pool c. java pool. d. program global area e. large pool 39 Marks: 1 You 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 return a syntax error. b. The statement will execute, but will NOT verify that values in the ID column do NOT violate the constraint.

c. The statement will achieves the desired results. d. The statement will execute, but will NOT enable the PRIMARY KEY constraint. 40 Marks: 1 Click 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 17JAN-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. Grouping the REQUIRED_DT and COMPL_DT columns is NOT allowed. b. Using the SUM aggregate function with the AMOUNT column is allowed in any portion of a statement. c. Using the AVG aggregate function on the AMOUNT column ignores null values. d. Using the SUM aggregate function on the AMOUNT column will result in erroneous results because the column contains null values. e. Using the AVG aggregate function with any column in the table is allowed. f. Using the MIN aggregate function on the COMPL_DT column will return a null value. 41 Marks: 1 Which statement type would be used to removed transactions more than one year from the TRX table ? Choose one answer. a. DML b. DRL c. DDL d. DCL e. TCL 42 Marks: 1 Why would you NOT create an index on a column in the CLASS_SCHEDULE table ? Choose one answer.

a. to speed up queries that returned less than 3 percent of the rows. b. to reduce disk I/O c. to speed up queries if the table is small d. to speed up queries that include a foreign key reference to the STUDENT table. e. to speed up row retrieval 43 Marks: 1 The STUDENT table contains these columns : FIRST_NAME VARCHAR2(25) ENROLL_DATE DATE You need to display the ENROLL_DATE values in this format : 25th of Febuary 2002 Choose one answer. a. SELECT enroll_date(?DDspth ?of? Month YYYY?) FROM student; b. SELECT TO_CHAR (enroll_date,?DDTH ?of? Month YYYY?) FROM student; c. SELECT TO_CHAR (enroll_date,?ddth ?of? Month YYYY?) FROM student; d. SELECT TO_CHAR (enroll_date,?DDspth?of? Month YYYY?) FROM student; 44 Marks: 1 Evaluate this iSQL*Plus command : START process_batch.sql Which iSQL*Plus command will achieve the same results ? Choose one answer. a. SAVE prcosse_batch.sql b. EXECUTE prcosse_batch.sql c. GET prcosse_batch.sql d. &prcosse_batch.sql e. @process_batch.sql 45 Marks: 1 The STUDENT table contains these columns : ID NUMBER(9) Primary Key LAST_NAME VARCHAR2(25) FIRST_NAME VARCHAR2(25) ENROLL_DATE DATE You create a report that displays the column headings and data in this format : Student Name Enrolled ----------------------------- Jones, Jennifer 12-SEP-01 Which two statements concerning this report?s SELECT statement are true (Choose two.) Choose at least one answer. a. A format mask must have been used on the ENROLL_DATE column b. One column alias is used for the LAST_NAME and FIRST_NAME columns. c. The display lengths of the LAST_NAME and FIRST_NAME column are increased.

d. Separate column aliases are used for the LAST_NAME, FIRST_NAME and ENROLL_DATE columns. e. The LAST_NAME and FIRST_NAME columns are concatenated togethe 46 Marks: 1 The ACCOUNT table contains these columns: ACCOUNT_ID NUMBER(12) NEW_BALANCE NUMBER(7,2) PERV_BALANCE NUMBER(7,2) FINANCE_CHARGE NUMBER(7,2) These are the desired result: 1.Display all accounts that have a new balance that is less than the previous balance. 2.Display all accounts that have a finance charge that is less than $25.00. 3.Include accounts that have no finance charge. Evaluate this statement: SELECT account_id FROM account WHERE new_balance < prev_balance AND NVL(finance_charge,0) < 25; What does the statement provide ? Choose one answer. a. none of the desired result b. one of the desired result c. all of the desired result d. two of the desired result 47 Marks: 1 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. 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 ? Choose one answer. a. Statement 1 will display the ?Calculated Profit? column heading. b. Statemen 1 will return a higer value than statement 2. c. Staement 1 and statement 2 will return the same value. d. One of the statement will NOT execute. 48 Marks: 1 User Marilyn wants to elimated the need to type the full table name when querying the TRANSACTION_HISTORY table existing in her schema. All other database users should use the schema and full table name when referncing this table. Which statement should Mrilyn execute ? Choose one answer. a. CREATE PUBLIC trans_hist SYNONYM FOR Marilyn, transaction_history; b. CREATE PRIVATE SYNONYM trans_hist FOR Marilyn, transaction_history;

c. CREATE SYNONYM trans_hist FOR transaction_history; d. CREATE PUBLIC SYNONYM trans_hist FOR Marilyn; 49 Marks: 1 Evaluate 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. the owner of the INVENTORY table c. any user with the DELETE object privilege on the INVENTORY table d. any user with the DROP ANY TABLE system privilege e. any user with access to the PUBLIC 50 Marks: 1 Evaluate this statement SELECT* FROM USER_CONS_COLUMNS; Logged on as user Ann, which task would you accomplish using this stement ? Choose one answer. a. display the names of the constraints on the table you can access b. count the number of UNIQUE constraints in your schema c. determine the type of constraint on the DEPT_ID column of the DEPARTMENT table in the user Chan schema d. display the column associated with the constraint in the table you own

51 Marks: 1 Which construct can be used to return data based on an unknown condition ? Choose one answer. a. a subquery b. a WHERE clause with an OR condition c. an ORDER BY clause d. a GROUP BY clause 52 Marks: 1 How many levels can subqueries be nested in a FROM clause ? Choose one answer. a. 4

b. 8 c. 16 d. unlimited e. 2 53 Marks: 1 The DEPARTMENT table contains these colums: DEPT_ID NUMBER, Primary Key DEPT_ABBR VARCHAR2(4) DEPT_NAME VARCHAR2(30) MGR_ID NUMBER The EMPLOYEE table contains these columns EMPLOYEE_ID NUMBER EMP_LNAME VARCHAR2(25) EMP_FNAME VARCHAR2(25) DEPT_ID NUMBER JOB_ID NUMBER MGR_ID NUMBER SALARY NUMBER HIRE_DATE DATE Evaluate this statement: ALTER TABLE employee ADD CONSTRAINT mgr_id_fk FOREIGN KEY (mgr_id) REFERENCES department(mgr_id); Which task will this statement accomplish? Choose one answer. a. Creates a referential constraint from the EMPLOYEE table to the DEPARTMENT table b. Prevents data from being inserted into the DEPARTMENT table that violates the constraint on the EMPLOYEE table c. Creates a referential constraint from the EMPLOYEE table to the EMPLOYEE table d. Prevents rows in the EMPLOYEE table from being deleted if they are referenced in the department table 54 Marks: 1 Click the Exhibit(s) button to examine the structure of the LINE_ITEM table. LINE_ITEM_ID NUMBER(9) NOT NULL, Primary Key ORDER_ID NUMBER(9) NOT NULL, Primary Key, Foreign Key to ORDER_ID column of the CURR_ORDER table PRODUCT_ID NUMBER(9) NOT NULL, Foreign Key to PRODUCT_ID column of the PRODUCT table You query the database with this SQL statement : SELECT order_id || ?-? || line_item || ?-? || product_id || ?-? || quantity ?Purchase? FROM line_item; Which component of the SELECT statement is a literal ? Choose one answer. a. || b. c. Purchase d. quantity 55 Marks: 1 Click the Exhibit(s) button to examine the data in the LINE_ITEM table. LINE_ITEM ORDER_ID PRODUCT_ID QUANTITY ---------------- --------------- --------------------- --------------- 2 1494 A-2356 7 3 1533 A-7849 18 6 1599 C-599 33 1 1533 A-3209 100 2

1533 A-3210 1 4 1494 Z-78 1 10 1588 C-555 250 3 1494 Z-9 5 You query the databse and return the values 23. Which script did you use ? Choose one answer. a. SELECT SUBSTR(product_id, -3, 2) FROM line_item WHERE line_item_id = 2 AND order_id = 1494; b. SELECT SUBSTR(product_id, 3) FROM line_item WHERE line_item_id = 2 AND order_id = 1494; c. SELECT SUBSTR(product_id, 3, -2) FROM line_item WHERE line_item_id = 2 AND order_id = 1494; d. SELECT SUBSTR(product_id, 3, 2) FROM line_item WHERE line_item_id = 2 AND order_id = 1494; 56 Marks: 1 Which statement about sequence is true ? Choose one answer. a. Creating a sequence causes sequence numbers are stired in a table. b. One sequence can be used for multiple table in the same schema. c. A sequence slows down the efficiency of accessing sequence values cached in memory. d. A sequence can only be used to create a primary key value. 57 Marks: 1 Click the Exhibit(s) button to examine the structure of the LINE_ITEM table. LINE_ITEM_ID NUMBER(9) NOT NULL, Primary Key ORDER_ID NUMBER(9) NOT NULL, Primary Key, Foreign Key to ORDER_ID column of the CURR_ORDER table. PRODUCT_ID NUMBER(9) NOT NULL, Foreign Key to PRODUCT_ID column of the PRODUCT table. You want to display order numbers, product numbers, and the quantity of the product orderes with these desired results : 1.The volume of the item must be 50 or greater. 2.The display must be sorted from the lowest to 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 ? Choose one answer. a. all of the desired results b. one of the desired results c. an error statement d. two of the desired results 58 Marks: 1 Which CREATE TABLE statement will fail ? (Choose aal that apply.)

Choose at least one answer. a. CREATE TABLE date (time_idNUMBER(9)); b. CREATE TABLE time (time_idNUMBER(9)); c. CREATE TABLE datetime (time_id NUMBER(9)); d. CREATE TABLE time *(time_id NUMBER(9)); e. CREATE TABLE time1 (time1 NUMBER(9)); f. CREATE TABLE $time (time_id NUMBER(9)); 59 Marks: 1 An application view is no longer needed. Which SQL statement should you use to remove the TRNAS_HITS_V view? Choose one answer. a. DROP trans_hist_v; b. TRUNCATE VIEW trans_hist_v; c. DROP VIEW trans_hist_v; d. DELETE trans_hist_v; 60 Marks: 1 The 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 COUNT(*), DISTINCT(location_id) FROM event; b. SELECT DISTINCT(event_type) FROM event GROUP BY location_id; 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 UNIQUE(location_id), COUNT(event_type) FROM event GROUP BY lacation_id; 61 Marks: 1 Click the Exhibit(s) button to examine the data from the AR_TRX_HY tables. AR_TRX TRX_ID TRX_TYPE QUANTITY UNIT_PRICE EXT_AMT TAX_AMT ---------- --------------- --------------- ------------------ ------------- ------------- 1 D 10 100.00 1000.00 80.00 2 D 2 50.00 100.00 7.00 3 D 10 20.00 200.00 14.00 AR_TRX-HY TRX_ID

TRX_TYPE QUANTITY UNIT_PRICE EXT_AMT TAX_AMT GRAND_TOTAL LOAD_DATE ----------- --------------- --------------- ------------------ ------------- ------------- --------------------- ----------------- 2 D 2 50.00 100.00 8.00 108.00 10-OCT-2001 You have been granted SELECT privileges on the AR_TRX_HY tab;es and INSERT, UPDATE and SELECT privileges on the AR_TRX table. You execute this statement : MERGE INTO ar_trx a USING ar_trx_hy h ON (a.trx_id = h.trx_id) WHEN MATCHED THEN UPDATE SET a.quantity = h.quantity, a.unit_price = h.unit_price, a.ext_amt = h.ext_amt, a.tax_amt = h.tax_amt WHEN NOT MATCHED THEN INSERT (trx_id, trx_type, quantity, unit_price, ext_amt, tax_amt) VALUES(h.trx_id, h.trx_type, h.quantity, h.unit_price, h.ext_amt, h.tax_amt); What is the result ? Choose one answer. a. Rows are inserted into the AR_TRX_HY table. b. One or more rows are updated in the AR_TRX table. c. Rows are inserted into the AR_TRX table. d. An error occurs because there you do NOT have MERGE privileges on the AR_TRX table. e. An error occurs because there are no rows in the second table that are not in the first table. f. One or more rows are updated in the AR_TRX_HY table. 62 Marks: 1 The 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 <= 50; What statement regarding the execution of this statement is true ? Choose one answer. a. The 50 greatest finance charge values were displayed from the highest to the lowest. b. The statement failed to execute because the ORDER BY does NOT use the Top-n column. c. The statement failed to execute because an inline view was not used. d. The ORDER BY clause was ignored because it was NOT places in the outer query. 63 Marks: 1 You query the database with this SQL statement: SELECT * FROM transaction; For which purpose was this statement created ? Choose one answer. a. to insert data into the TRANSACTION table

b. to review the structure of the TRANSACTION table c. to deleted selected data from the TRANSACTION table d. to view the data in the TRANSACTION table 64 Marks: 1 Which three statements concerning explicit data type conversions are true ? (choose two) Choose at least one answer. a. A date value may be converted to a number value using the TO_NUMBER function. b. A date value may be converted to a character string using the TO_CHAR function. c. A number value may be converted to a character string using the TO_CHAR function. d. A date value may be converted to a character value using TO_DATE function. e. A character value may be converted to a date value using TO_DATE function. f. A number value may be converted to a date value using the TO_DATE function. 65 Marks: 1 For 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 have columns with identical names. b. You want to perform a natural join of the PRODUCT and VENDOR tables but limit the number of columns in the join condition. c. The PRODUCT and VENDOR tables have corresponding columns, but the column in the VENDOR table contains null values taht need to displayed. 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 do NOT have columns with identical names. 66 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 WHERE list_price > 400; b. SELECT SUM(*) FROM product WHERE list)price > 400; c. SELECT COUNT(*) FROM product ORDER BY list_price; d. SELECT SUM(*) FROM product GROUP BY list_price > 400; 67 Marks: 1 When could an index decrease the speed of a query ? Choose one answer. a. The column is used in a WHERE clause. b. The table is small. c. The column contains a large number of null value. d. The column contains a wide range of values. 68 Marks: 1 You have redo log members in each redo log group in your database. You are required to add a redo log member to an existing group in your database to increase the probability of recovering the redo logs in case of any failure. What will happen if you attempt to add a member to an existing group without using the SIZE option ? Choose one answer. a. The Oracle server will use the size of the existing members in the group b. The statement will fail. c. The statement will prompt for the size of the redo log file. d. The Oracle server will use a multiple of the DB_BLOCK_SIZE parameter e. The Oracle server will use the default redo log member size. 69 Marks: 1 Evaluate 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 = NULL; b. WHERE quantity != NULL; c. WHERE quantity IS NULL; d. WHERE quantity <> NULL;

70 Marks: 1 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) Choose at least one answer. a. VALUE b. STOT c. SUM d. TSUM e. COUNT f. STTDEV

71 Marks: 1 Evaluate this SELECT statement : SELECT employee_id, name FROM employee WHERE employee_id NOT IN (SELECT employee_id FROM employee WHERE departement_id = 30 AND job = ?CLERK?); What would happens if the inner query returned a NULL value ? Choose one answer. a. No rows would be selected from the EMPLOYEE table. b. Only the rows with EMPLOYEE_ID values equal to NULL would be included in the results. c. A syntax error would be returned. d. All the EMPLOYEE_ID and NAME values in the EMPLOYEE table would be displayed. 72 Marks: 1 Which logical condition operator, used in a WHERE clause, returns TRUE only when both of the conditions are true ? Choose one answer. a. NOT b. AND c. OR d. LIKE 73 Marks: 1 User 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. ALTER USER dave IDENTIFIED BY NEW PASSWORD dave500; b. ALTER USER dave IDENTIFIED BY PASSWORD dave500; c. ALTER USER dave IDENTIFIED BY dave500; d. ALTER USER dave NEW PASSWORD dave500; e. User Dave CANNOT change his password. 74 Marks: 1 Click 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-SEP2001 1000 1000 02-OCT-2001 2 1 22-FEB-2002 1000 3 2 08-OCT2001 10 10 28-OCT-2001 4 2 10-DEC-2001 50 5 3 02-NOV2001 10000 9000 28-DEC-2001 6 3 05-JAN2002 1000 1000 31-JAN-2001 7 4 09-NOV2001 2100 2100 15-DEC-2001 8 5 09-DEC2001 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. Change the outer query WHERE clause to ?WHERE donor_id LIKE?. c. Change the subquery WHERE clause to ?WHERE clause to ?WHERE amount_pledged = 1000.00 AND pledge_dt = ?05-JAN-2002??. d. Remove the subquery WHERE clause. e. Change the outer query WHERE clause to ?WHERE donor_id IN?. f. Remove the single quotes around the date value in the inner query WHERE clause. 75 Marks: 1

Click 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 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; 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_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; d. 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; 76 Marks: 1 You created a view that contains gropus of data, does NOT allow DML operations, and does not contain a subquery. Which type of view did you create ? Choose one answer. a. explicit b. complex c. inline d. simple 77 Marks: 1 When 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 NULL (.009 * prev_balance, 0) + new_balance ?Current Balance? FROM account; b. SELECT NVL (.009 * prev_balance, 0) + new_balance ?Current Balance? FROM account; c. SELECT IS NULL (.009 * prev_balance, 0) + new_balance ?Current Balance? FROM account; d. SELECT TO NUMBER (.009 * prev_balance, 0) + new_balance ?Current Balance? FROM account; 78 Marks: 1 The 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, subject_id FROM teacher; b. SELECT last_name, first_name, id FROM teacher; c. SELECT * FROM teacher; d. SELECT last_name, first_name, subject_id FROM teacher; 79 Marks: 1 Evaluate this CREATE TABLE statement : 1.CREATE TABLE supplier( 2.supplier_id NUMBER, 3.supplier_naem VARCHAR@(25), 4.address VARCHAR2(25), 5.city VARCHAR2(25), 6.region VARCHAR2(25), 7.postal_code VARCHAR2(11), 8.CONSTRAINT supplier_id _pk PRIMARY KEY(supplier_id), 9.CONSTRAINT supplier_name_nn NOT NULL(supplier_name), 10.CONSTRAINT postal_code_fk FOREIGN LEY(postal_code) REFERENCES postal_code(code)); Which line will cause an error ? Choose one answer. a. 1 b. 2 c. 7 d. 10 e. 9 f. 8 80 Marks: 1 Which condition would allow a user to grant SELECT privileges on the CUSTOMER table to everyone using the PUBLIC keyword ?

Choose one answer. a. The user has been granted the PUBLIC privileges. b. The user owns the CUATOMER table. c. The user has been granted the SELECT privileges with the PUBLIC OPTION. d. The user hs SELECT privileges on the CUATOMER table.

81 Marks: 1 The 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. PO_NUM only b. PRODUCT_ID only c. PO_LINE_ID only d. both PO_NUM and PO_LINE_ID e. UNIT_PRICE only 82 Marks: 1 The 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 technician_id, COUNT(technician_id) FROM services WHERE service_date BETWEEN?01-JAN-2001? AND ?30-JUN-2001? ORDER BY technician_id; b. SELECT COUNT(*) FROM services WHERE service_date bBETWEEN?01JAN-2001? AND ?30-JUN-2001? GROUP BY 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,service_date,COUNT(*) FROM services WHERE service_date BETWEEN?01-JAN-2001? AND ?30-JUN-2001? ORDER BY technician_id, service_date; 83 Marks: 1 Click 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. natural join c. cross join d. equijoin 84 Marks: 1 Click the Exhibit(s) button to examine the data from the 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-FEB2002 1000 3 2 08-OCT-2001 10 10 28-OCT-2001 4 2 10-DEC-2001 50 5 3 02-NOV2001 10000 9000 28-DEC-2001 6 3 05-JAN-2002 1000 1000 31-JAN-2001 7 4 09NOV-2001 2100 2100 15-DEC-2001 8 5 09-DEC-2001 110 110 29-DEC-2001 You need to determine the average payment amount made by each donor during the last quarter of 2001. which SELECT statement should you use ? Choose one answer. a. SELECT donor_id, AVG(NVL(amount_paid,0)) FROM donation WHERE payment_dt BETWEEN ?01-OCT-2001? and ?31-DEC-2001?; b. SELECT donor_id, AVG(NVL(amount_paid,0)) FROM donation WHERE payment_dt BETWEEN ?01-OCT-2001? and ?31-DEC-2001? GROUP BY donor_id; c. SELECT donor_id, MEAN(amount_paid) FROM donation WHERE payment_dt BETWEEN ?01-OCT-2001? and ?31-DEC-2001? GROUP BY donor_id; d. SELECT donor_id, AVG(amount_paid,0) FROM donation WHERE payment_dt BETWEEN ?01-OCT-2001? and ?31-DEC-2001?; e. SELECT donor_id, AVG(NULLIF(amount_paid,0)) FROM donation WHERE payment_dt BETWEEN ?01-OCT-2001? and ?31-DEC-2001? GROUP BY donor_id; 85 Marks: 1 The 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 all FROM account; b. SELECT account_id, new_balance, prev_balance, finance_charge FROM account; c. SELECT any FROM account; d. SELECT * FROM account; 86 Marks: 1 You issued this statement : REVOKE REFERENCES ON inventory FROM joe CASCADE CONSTRAINTS; Which two tasks were accomplished by the executing this statement ? (Choose two.) Choose at least one answer. a. All the PRIMARY KEY constraints created by user Joe were removed. b. The ability to create PRIMARY KEY constraint was revoked from user Joe. c. All the FOREIGN KEY constraints on the INVENTORY table created by user Joe were removed. d. The ability to create any constraints was revoked from user Joe. e. All the constraints created by user Joe were removed. f. The ability to create FOREIGN KEY constraint on the INVENTORY table was revoked from user Joe. 87 Marks: 1 Examine the structures of the CURR_ORDER and LINE_ITEM tables : CURR_ORDER ------------------- ORDER_ID NUMBER(9) CUSTOMER_ID NUMBER(9) ORDER_DATE DATE SHIP_DATE DATE LINE_ITEM --------------LINE_ITEM _ID NUMBER(9) ORDER_ID NUMBER(9) PRODUCT_ID NUMBER(9) QUANTITY NUMBER(5) The ORDER_ID column in the lINE_ITEM table has a FOREIGN KEY constraint to the CURR_ORDER table. Which statement about these two tables is true ? Choose one answer. a. To remove the constraint from the LINE_ITEM table, you must delete all the records in the CURR_ORDER table. b. To update a record in the CURR_ORDER table, the parent record must already exist in the LINE_ITEM table. c. When a record is deleted from the LINE_ITEM table, the associated parent record in the CURR_ORDER table is also deleted. d. To insert a record into the CURR_ORDER table, you must insert a record into the LINE_ITEM table. e. To delete a record from the CURR_ORDER table, you must delete any child records into the LINE_ITEM table. f. To delete a record from the LINE_ITEM table, you must delete the associated record in the CURR_ORDER table.

88 Marks: 1 Which data type is a hexadecimal string representing the unique address of a row in its table ? Choose one answer. a. VARCHAR2 b. BFILE c. ROWID d. RAW 89 Marks: 1 You granted user Joe the INDEX and REFERENCES privileges on the INVENTORY table. Which statement did you use ? Choose one answer. a. GRANT ALL ON inventory TO joe; b. GRANT ALL WITH GRANT OPTION ON inventory TO joe; c. GRANT INDEX AND REFERENCES ON inventory TO joe; d. GRANT ANY PRIVILEGE ON inventory TO joe; 90 Marks: 1 You 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. 600 c. 100 d. 260

91 Marks: 1 Click the Exhibit(s) button to examine the structures of the EMPLOYEE, PROJECT, and TASK 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 PROJECT ------------- PROJECT_ID NUMBER NOT NULL, Primary Key PROJECT_NAME VARCHAR2(30) MGR_ID NUMBER PROJECT_TYPE VARCHAR2(10) BEGIN_DT DATE END_DT DATE TASK -------PROJECT_ID NUMBER NOT NULL, Primary Key, Foreign Key to PROJECT_ID of the PROJECT table. TASK_ID NUMBER NOT NULL, Primary Key

EST_COMPL_DATE DATE EMPLOYEE_ID NUMBER Foreign Key to EMPLOYEE_ID of the EMPLOYEE table. You want to create a report of all employees, including employee name and project name, who are assigned to project tasks. You want to include all projects even if they currently have no tasks defined, and you want to include all tasks, even those are not assigned to an employee. Which join should you use ? Choose one answer. a. a SELF JOIN on the EMPLOYEE table and a LEFT OUTER JOIN between the TASK and PROJECT tables. b. a NATURAL JOIN between the TASK and EMPLOYEE tables and a NATURAL JOIN between the TASK and PROJECT tables. c. a FULL OUTER JOIN between the TASK and EMPLOYEE tables and a FULL OUTER JOIN between the TASK and PROJECT tables. d. a FULL OUTER JOIN between the TASK and EMPLOYEE tables and a NATURAL JOIN between the TASK and PROJECT tables. e. a LEFT OUTER JOIN between the TASK and EMPLOYEE tables and a RIGHT OUTER JOIN between the TASK and PROJECT tables. f. a NATURAL JOIN between the TASK and EMPLOYEE tables and a LEFT OUTER JOIN between the TASK and PROJECT tables. 92 Marks: 1 Examine 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 players who play on the same team with ?John Wilcox? b. a list of all players who received a signing bonus that was lower than the average c. a list of all players, including manager name and signing bonus than their manager d. a list of all teams that have more than 11 players e. a list of all players that are also managers 93 Marks: 1 Evaluate 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 set TEACHER_NAME column heading to ?Teacher?. b. It will limit the TEACHER_NAME column heading to 25 characters.

c. It will center the column heading the TEACHER_NAME column. d. It will set the display width of the TEACHER_NAME column to 25. e. It will display the current settings for the TEACHER_NAME column. 94 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. GROUP BY b. SELECT c. WHERE d. ORDER BY 95 Marks: 1 The EMPLOYEE table contains these columns: EMP_ID NUMBER(9) LAST_NAME VARCHAR2(20) FIRST_NAME VARCHAR2(20) COMM_PCT NUMBER(2) You need to display the commission percentage for each employee followed by percent sign (%). If an employee does not receive a commission, the output display ?No Comm?. Employee commission do not exceed 20 percent. Which statement should you use to achieve these result ? Choose one answer. a. SELECT emp_id, last_name, NVL(comm._pct||?%?,?No Comm?) FROM employee; b. SELECT emp_id, last_name, RPAD(NVL(comm._pct),?No Comm?,3,?%?) FROM employee; c. SELECT emp_id, last_name, NVL(TO_CHAR(comm._pct||?%?),?No Comm?) FROM employee; d. None of the statements returns the desired result 96 Marks: 1 You issue this statement : CREATE PUBLIC SYNONYM part FOR linda.product; Which task was accomplished by this statement ? Choose one answer. a. A new system privilege was assigned. b. A new object privilege was assigned.

c. The need to qualify an object name with its schema was elimated. d. A newsegment object was created. 97 Marks: 1 Which clause you use to limit the price value to 100.00 or less ? Choose one answer. a. CONSTRAINT CHECK inventory_price_ck (price <= 100.00) b. CONSTRAINT inventory_price_ck CHECK (price < = 100.00) c. CONSTRAINT CHECK inventory_price_ck (price < 100.00) d. CONSTRAINT inventory_price_ck CHECK (price IN (100.00)) e. CONSTRAINT inventory_price_ck CHECK (price < 100.00) 98 Marks: 1 Which three statements about a column true ? (Choose two) Choose at least one answer. a. You CANNOT specify the column?s position when adding a new column to a table. b. You CANNOT modify the data type of a column if the column contains nonnull data. c. You CANNOT decrease the width of a CHAR column. d. You CANNOT convert a CHAR data type column to the VARCHAR2 data type. e. You CANNOT rename a column. f. You CANNOT increase the width of a VARCHAR2 column. 99 Marks: 1 Click the Exhibit(s) button to examine the structure of the PO_DETAIL table. PO_NUM PO_LINE_ID PRODUCT_ID QUANTITY UNIT_PRICE -------------- ---------------- -------------------- --------------- ------------------- 10052 1 1 100 10.30 10052 2 2 100 10.00 10054 1 1 50 72.10 10054 2 1 10 10.00 10054 3 3 10 10.00 Which statement will permanently remove all the data in, the indexes on, and the structure of the PO_DETAIL table ? Choose one answer. a. TRUNCATE TABLE po_detail; b. DELETE TABLE po_detail; c. DROP TABLE po_detail; d. ALTER TABLE po_detail SET UNUSED (po_num, po_line_id, product_id, quantity, unit_price);

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

You might also like