Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Is it possible to declare column which has the number data type and its scale larger than the precision? For example defining columns like: column name NUMBER (10,100), column name NUMBER (10,-84)

Answer»
  • Yes, these type of declarations are POSSIBLE.
  • Number (9, 12) INDICATES that there are 12 DIGITS after DECIMAL POINT. But since the maximum precision is 9, the rest are 0 padded like 0.000999999999.
  • Number (9, -12) indicates there are 21 digits before the decimal point and out of that there are 9 possible digits and the rest are 0 padded like 999999999000000000000.0
2.

In what cursor attributes the outcomes of DML statement execution are saved?

Answer»
  • The outcomes of the execution of the DML statement is saved in the FOLLOWING 4 CURSOR attributes:
    • SQL%FOUND: This returns TRUE if at least one row has been PROCESSED.
    • SQL%NOTFOUND: This returns TRUE if no rows were processed.
    • SQL%ISOPEN: This checks whether the cursor is open or not and returns TRUE if open.
    • SQL%ROWCOUNT: This returns the NUMBER of rows processed by the DML statement.
3.

What is the difference between a mutating table and a constraining table?

Answer»
  • A table that is being MODIFIED by the usage of the DML STATEMENT currently is KNOWN as a mutating table. It can also be a table that has triggers defined on it.
  • A table used for reading for the purpose of referential INTEGRITY CONSTRAINT is called a constraining table.
4.

How can you debug your PL/SQL code?

Answer»
  • We can USE DBMS_OUTPUT and DBMS_DEBUG statements for DEBUGGING our code:
    • DBMS_OUTPUT PRINTS the output to the STANDARD console.
    • DBMS_DEBUG prints the output to the log FILE.
5.

What are COMMIT, ROLLBACK and SAVEPOINT statements in PL/SQL?

Answer»
  • These are the three transaction specifications that are available in PL/SQL.
  • COMMIT: Whenever any DML operations are performed, the data gets manipulated only in the database buffer and not the ACTUAL database. In order to save these DML transactions to the database, there is a need to COMMIT these transactions.
    • COMMIT transaction action does saving of all the outstanding changes since the last commit and the below steps take place:
      • The RELEASE of AFFECTED rows.
      • The transaction is marked as complete.
      • The DETAILS of the transaction would be stored in the data dictionary.
    • Syntax: COMMIT;
  • ROLLBACK: In order to undo or erase the changes that were done in the CURRENT transaction, the changes need to be rolled back. ROLLBACK statement erases all the changes since the last COMMIT.
    • Syntax: ROLLBACK;
  • SAVEPOINT: This statement gives the name and defines a point in the current transaction process where any changes occurring before that SAVEPOINT would be preserved whereas all the changes after that point would be released.
    • Syntax: SAVEPOINT <savepoint_name>;