Presentation is loading. Please wait.

Presentation is loading. Please wait.

1. 1. Which type of argument passes a value from a procedure to the calling program? A. VARCHAR2 B. BOOLEAN C. OUT D. IN 2.

Similar presentations


Presentation on theme: "1. 1. Which type of argument passes a value from a procedure to the calling program? A. VARCHAR2 B. BOOLEAN C. OUT D. IN 2."— Presentation transcript:

1 1

2 1. Which type of argument passes a value from a procedure to the calling program? A. VARCHAR2 B. BOOLEAN C. OUT D. IN 2

3 CREATE OR REPLACE TRIGGER update_emp AFTER UPDATE ON emp BEGIN INSERT INTO audit_table (who, dated) VALUES (USER, SYSDATE); END; 2. You issue an UPDATE command in the EMP table that resulted in changing 10 rows. How many rows are inserted into the AUDIT_TABLE? A. 1 B. 10 C. None D. A value equal to the number of rows in the EMP table. 3

4 3. Which table name is valid? A. #_667 B. Number C. Catch_#22 D. 1996_invoices 4

5 4. You want to display the average salary for the departments 20 and 50, but only if those departments have an average salary of at least 2000. Which statement will produce the required results A. SELECT deptno, AVG(sal) FROM emp WHERE deptno IN (20,50) GROUP BY deptno HAVING AVG (sal)>=2000; B. SELECT deptno, AVG(sal) FROM emp GROUP BY deptno HAVING AVG (sal)>=2000; Deptno IN (20,50); C. SELECT deptno, AVG(sal) FROM emp WHERE deptno IN (20,50) AND AVG (sal)>=2000 GROUP BY deptno; D. SELECT deptno, AVG(sal) FROM emp WHERE deptno IN (20,50) GROUP BY AVG(sal) HAVING AVG(sal)>=2000 5

6 5. Why do stored procedures and functions improve performance? A. They reduce network round trips. B. They allow the application to perform high speed processing locally. C. They reduce the number of calls to the database and decrease network traffic by bundling commands. D. They reduce the number of calls to the database and decrease network traffic by using the local PL/SQL engine. 6

7 6. You have decided to permanently remove all the data from the STUDENT table and you need the table structure in the future. Which single command performs this? A. TRUNCATE TABLE student; B. DROP TABLE student; C. ROLLBACK TABLE student; D. Delete from table student; 7

8 7. Evaluate the following IF statement: IF v_value > 10 THEN v_new_value:=2*v_value; ELSIF v_value > 20 THEN v_new_value:=3*v_value; ELSIF v_value > 30 THEN v_new_value:=4*v_value; ELSE v_new_value:=5*v_value; END IF What would be assigned to v_new_value if v_value = 50? A. 50 B. 100 C. 150 D. 250 8

9 8. Written a PL/SQL loop, you need to test if the current FETCH was successful. Which SQL cursor attribute would you use to accomplish this task? A. SQL%ISOPEN B. SQL%FOUND C. SQL%OPEN D. An SQL cursor attribute cannot be used inside a PL/SQL loop. 9

10 9. Which statement is true when writing a cursor FOR loop? A. You must explicitly fetch the rows within a cursor FOR loop. B. You must explicitly open the cursor prior to the cursor FOR loop. C. You must explicitly close the cursor prior to the end of program. D. You do not explicitly open, fetch or close a cursor within a cursor FOR loop. 10

11 10. Evaluate this PL/SQL block: BEGIN FOR i IN 1..10 LOOP IF I=4 OR I=6 THEN null; ELSE INSERT INTO test(result) VALUES (I); END IF; COMMIT; END LOOP; ROLLBACK; END; How many values will be inserted into the TEST table? A. 4 B. 6 C. 8 D. 10 11


Download ppt "1. 1. Which type of argument passes a value from a procedure to the calling program? A. VARCHAR2 B. BOOLEAN C. OUT D. IN 2."

Similar presentations


Ads by Google