Oracle Database Programming MCQs with Answers
Practice important Oracle Database Programming MCQs with answers and explanations.
Multiple Choice Questions
Q71: Which of the following is a valid PL/SQL variable declaration?
- A: a number(5) := 10;
- B: name varchar2(30) := ‘abc’;
- C: dob date := sysdate;
- D: PI CONSTANT NUMBER := 3.1415;
View Answer
D
Q72: How is output displayed in PL/SQL?
- A: print_output
- B: console_write
- C: dbms_output.put_line
- D: system_display
View Answer
C
Q73: In the code f := 70.0 / 3.0;, what is the value of f?
- A: 23
- B: 21.3
- C: 25.3
- D: 23.333333333333
View Answer
D
Q74: What happens if a variable is declared in both the outer and inner blocks in PL/SQL?
- A: Inner block variable is ignored
- B: Outer block variable is overridden
- C: Both values are displayed
- D: Error occurs
View Answer
B
Q75: Which of the following is an example of a global variable in PL/SQL nested blocks?
- A: num1 declared in outer block
- B: num2 declared in outer block
- C: num3 declared in outer block
- D: num1 declared in inner block
View Answer
A
Q76: What is the value of num2 in the inner block in the code below?
- A: 85
- B: 195
- C: 95
- D: 100
View Answer
B
Q77: In the nested block example, why is the value of num1 the same in both the inner and outer blocks?
- A: num1 is declared in the inner block
- B: num1 is declared only in the outer block
- C: num1 is a constant
- D: num1 is passed as a parameter
View Answer
B
Q78: In the PL/SQL block structure, which part is optional?
- A: DECLARE part
- B: BEGIN part
- C: END part
- D: EXECUTION part
View Answer
A
Q79: What is the data type of Cost in the following declaration: Cost real := 390;?
- A: real
- B: integer
- C: number
- D: date
View Answer
A
Q80: Which of the following data types can handle floating-point values in PL/SQL?
- A: integer
- B: varchar2
- C: real
- D: number
View Answer
C