Oracle Database Programming MCQs with Answers
Practice important Oracle Database Programming MCQs with answers and explanations.
Multiple Choice Questions
Q231: What is the primary function of the `DELETE` attribute in PL/SQL tables?
- A: To remove specific elements or all elements from the table
- B: To count the number of elements in the table
- C: To return the first element in the table
- D: To check if an element exists at a given index
View Answer
A
Q232: In the `Implementing PL/SQL Table -II` example, what is the significance of incrementing `counter` by 2?
- A: It creates gaps of 2 between indices in the `c3` table
- B: It ensures that all indices are consecutive
- C: It sets the maximum value of indices to 2
- D: It initializes the counter to 2
View Answer
B
Q233: What is the purpose of the `Implementing PL/SQL Table -IV` scenario?
- A: To load employee names into one PL/SQL table and copy them to another before deleting from the first table
- B: To load employee names into a SQL table and update them
- C: To count the number of employees in the PL/SQL table
- D: To delete all entries in a PL/SQL table
View Answer
A
Q234: Which attribute in PL/SQL tables is used to check if an index exists before performing operations on it?
- A: EXISTS
- B: COUNT
- C: DELETE
- D: FIRST
View Answer
A
Q235: What will be the output of the `Implementing PL/SQL Table and SQL-I` example?
- A: Rows are inserted into the `history` table with employee names and current dates
- B: Rows are deleted from the `history` table
- C: Only employee names are displayed on the screen
- D: The `history` table is not modified
View Answer
A
Q236: What is a record in programming?
- A: A group of related data items stored in fields
- B: A type of array
- C: A form of a database table
- D: A programming loop
View Answer
A
Q237: Which of the following is NOT a type of record?
- A: Table Base
- B: Cursor Base
- C: Column Base
- D: User Defined
View Answer
C
Q238: What does a table-based record in PL/SQL correspond to?
- A: A list of fields in a table
- B: A virtual table created by a cursor
- C: A dynamic array
- D: A user-defined structure
View Answer
A
Q239: How does a cursor-based record differ from a table-based record?
- A: It is based on a SELECT list of a cursor
- B: It corresponds directly to table columns
- C: It has a fixed size
- D: It uses numeric indexing
View Answer
A
Q240: What is the purpose of the `emp_rec` variable in the PL/SQL block?
- A: To store employee data temporarily
- B: To define a new table
- C: To execute a SELECT query
- D: To declare a cursor
View Answer
B