EU
EU
1. SQL is a common access language for many types of databases, including Oracle. True or False?
True (*)
2. A program which specifies a list of operations to be performed sequentially to achieve the desired result can be called:
5. Which lines of code will correctly display the message "The cat sat on the mat"? (Choose two.)
6. What kind of block is defined by the following PL/SQL code? BEGIN DBMS_OUTPUT.PUT_LINE('My first quiz'); END;
7. Every PL/SQL anonymous block must start with the keyword DECLARE. True or False?
9. Which component of Oracle Application Express is used to enter and run SQL statements and PL/SQL blocks?
10. Using Oracle Application Express, you can create Web applications that include PL/SQL. True or False?
11. The fact that PL/SQL is portable is a good thing because: Mark for Review (1) Points
12. Which of the following statements about exception handling in PL/SQL is false?
13. The implicit data type conversion at Point A may not work correctly. Why not? DECLARE v_mydate DATE; BEGIN V_MYDATE := '29-Feb-04'; -- Point A END;
14. Which of the following are valid assignment statements? (Choose two.)
15. Single row character functions are valid SQL functions in PL/SQL. True or False?
18. What is the output when the following program is executed? set serveroutput on DECLARE a VARCHAR2(10) := '333'; b VARCHAR2(10) := '444'; c PLS_INTEGER; d VARCHAR2(10); BEGIN c := TO_NUMBER(a) + TO_NUMBER(b); d := a || b; DBMS_OUTPUT.PUT_LINE(c); DBMS_OUTPUT.PUT_LINE(d); END;
19. Examine the following code: 1 DECLARE 2 x NUMBER; 3 BEGIN 4 x:= '300'; 5 END; After line 4, what is the value of x?
20. Which of the following are disadvantages of implicit data type conversions? (Choose two.)
21. If you are using the %TYPE attribute, you can avoid hard coding the: Mark for Review (1) Points
22. A variable must have a value if NOT NULL is specified. True or False?
24. When an exception occurs within a PL/SQL block, the remaining statements in the executable section of the block are skipped. True or False?
25. In the following code, Line A causes an exception. What value will be displayed when the code is executed? DECLARE outer_var VARCHAR2(50) := 'My'; BEGIN outer_var := outer_var || ' name'; DECLARE inner_var NUMBER; BEGIN inner_var := 'Mehmet'; -- Line A outer_var := outer_var || ' is'; END; outer_var := outer_var || ' Zeynep'; EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE(outer_var); END;
26. When nested blocks are used, which blocks can or must be labeled?
28. What will be displayed when the following code is executed? DECLARE varA NUMBER := 12; BEGIN DECLARE varB NUMBER := 8; BEGIN varA := varA + varB; END; DBMS_OUTPUT.PUT_LINE(varB); END;
31. Type of a variable determines the range of values the variable can have and the set of operations that are defined for values of the type.
32. Variables can be assigned a value in both the Executable and Declaration sections of a PL/SQL program. True or False?
33. Is the following variable declaration correct or not ? DECLARE display_qty CONSTANT NUMBER;
34. When a variable is defined using the NOT NULL keywords, the variable must contain a value. True or False?
36. To comment a single line of code, use two dashes after the comment. True or False?
37. Which of the following will help to make code easier to read?
38. Which of the following is an example of using a case convention for good programming practice?
1. Which of the following are valid identifiers? (Choose two.) Mark for Review (1) Points
42. Which is the correct way to erase one row from a table?
43. A PL/SQL block includes the following statement: SELECT last_name INTO v_last_name FROM employees WHERE employee_id=100; What is the value of SQL%ISOPEN immediately after the SELECT statement is executed?
44. Assume there are 5 employees in Department 10. What happens when the following statement is executed? UPDATE employees SET salary=salary*1.1;
45. Which one of these SQL statements can be directly included in a PL/SQL executable block?
46. The following code will return the last name of the employee whose employee id is equal to 100: True or False? DECLARE v_last_name employees.last_name%TYPE; employee_id employees.employee_id%TYPE := 100; BEGIN SELECT last_name INTO v_last_name FROM employees WHERE employee_id = employee_id; END;
47. Which one of these SQL statements can be directly included in a PL/SQL executable block?
48. Which rows will be deleted from the EMPLOYEES table when the following code is executed? DECLARE salary employees.salary%TYPE := 12000; BEGIN DELETE FROM employees WHERE salary > salary; END;