0% found this document useful (0 votes)
176 views44 pages

EU

This document contains 50 multiple choice questions about SQL and PL/SQL. The questions cover topics such as data types, variables, blocks, exceptions, transactions, and DML statements. They test knowledge of syntax, semantics, and proper usage of SQL and PL/SQL features.

Uploaded by

Virga Liliana
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
176 views44 pages

EU

This document contains 50 multiple choice questions about SQL and PL/SQL. The questions cover topics such as data types, variables, blocks, exceptions, transactions, and DML statements. They test knowledge of syntax, semantics, and proper usage of SQL and PL/SQL features.

Uploaded by

Virga Liliana
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 44

l questions in this section)

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:

3. Which of the following statements about PL/SQL and SQL is true?

4. Which PL/SQL block type must return a value?

5. Which lines of code will correctly display the message "The cat sat on the mat"? (Choose two.)

(Choose all correct answers)

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?

8. Which keywords must be included in every PL/SQL block? (Choose two.)

(Choose all correct answers)

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.)

(Choose all correct answers)

15. Single row character functions are valid SQL functions in PL/SQL. True or False?

16. TO_NUMBER, TO_CHAR, and TO_DATE are all examples of:

17. What is wrong with this assignment statement? myvar :=

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.)

(Choose all correct answers)

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?

23. Which of the following declarations is invalid?

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?

27. PL/SQL does not look _________ in the child blocks.

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;

29. A collection is a composite data type. True or False?

30. Which of these are PL/SQL data types? (Choose three.)

(Choose all correct answers)

er all questions in this section)

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?

35. Evaluate the following declaration. Determine whether or not it is legal.

DECLARE maxsalary NUMBER(7) = 5000;

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?

39. Reserved words can be used as identifiers. True or False?

40. Valid identifiers begin with a

1. Which of the following are valid identifiers? (Choose two.) Mark for Review (1) Points

(Choose all correct answers)

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;

49. How many DML statements can be included in a single transaction?

50. Which of the following best describes a database transaction?

You might also like