PL/SQL Flashcards

1
Q

Which of the following is a valid PL/SQL block?

a) BEGIN dbms_output.put_line('Hello, World!');
b) DECLARE v_number NUMBER := 100;
c) BEGIN v_number := 100; END;
d) DECLARE v_number NUMBER := 100; BEGIN dbms_output.put_line(v_number); END;

A

d) DECLARE v_number NUMBER := 100; BEGIN dbms_output.put_line(v_number); END;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which of the following is NOT a valid PL/SQL data type?

a) NUMBER
b) VARCHAR2
c) BOOLEAN
d) STRING

A

d) STRING

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

In PL/SQL, which keyword is used to handle exceptions?

  • a) TRY
  • b) CATCH
  • c) EXCEPTION
  • d) ERROR
A
  • c) EXCEPTION
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What will the following PL/SQL block output?

DECLARE
v_number NUMBER := 10;
BEGIN
v_number := v_number * 2;
dbms_output.put_line(v_number);
END;

a) 10
b) 20
c) 30
d) 40

A

b) 20

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which of the following is used to declare a cursor in PL/SQL?

  • a) OPEN cursor_name
  • b) DECLARE cursor_name
  • c) CURSOR cursor_name IS
  • d) FETCH cursor_name
A
  • c) CURSOR cursor_name IS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly