Oracle Database Programming MCQs with Answers
Practice important Oracle Database Programming MCQs with answers and explanations.
Multiple Choice Questions
Q241: In PL/SQL, which attribute is used to check if an element exists in a PL/SQL table?
- A: EXISTS
- B: COUNT
- C: FIRST
- D: LAST
View Answer
A
Q242: What does the `COUNT` attribute in PL/SQL tables return?
- A: The total number of elements in the table
- B: The number of columns in the table
- C: The index of the first element
- D: The index of the last element
View Answer
A
Q243: Which attribute would you use to remove a specific entry from a PL/SQL table?
- A: DELETE
- B: COUNT
- C: EXISTS
- D: FIRST
View Answer
A
Q244: How can you delete all elements in a PL/SQL table?
- A: DELETE ALL
- B: DELETE
- C: DELETE (1, COUNT)
- D: DELETE (m, n)
View Answer
B
Q245: In the provided PL/SQL block, how is the `emp_rec` variable used in the INSERT statement?
- A: It is inserted into the `emp` table with all its fields
- B: It is used to create a new table
- C: It modifies an existing table
- D: It queries data from the `emp` table
View Answer
A
Q246: What does the `NEXT` attribute in PL/SQL return?
- A: The next index number following a given index
- B: The number of elements in the table
- C: The first element in the table
- D: The last element in the table
View Answer
A
Q247: Which PL/SQL block uses the `DELETE` attribute to remove entries from a table?
- A: PL/SQL Table and First and Next Attribute
- B: PL/SQL Table and Count Attribute
- C: PL/SQL Table and Exist Attribute
- D: PL/SQL Table and Delete Attribute
View Answer
D
Q248: What does the `EXISTS` function in PL/SQL check?
- A: If a specific index exists in the PL/SQL table
- B: If an element is at the last position
- C: If the table has no elements
- D: If the table is empty
View Answer
A
Q249: Which of the following is a correct way to define a User Defined Record in PL/SQL?
- A: TYPE
IS RECORD ( , ...); - B: TYPE
IS ARRAY ( , ...); - C: TYPE
IS TABLE ( , ...); - D: TYPE
IS OBJECT ( , ...);
View Answer
A
Q250: What does the PL/SQL block in Implementing User Defined Record – I do?
- A: Displays information of the first 5 employees with 'MAN' in their job title
- B: Updates employee salaries by 20%
- C: Deletes records from the `emp` table
- D: Creates a new table with employee details
View Answer
A