Top Most Programmatic Constructs Interview Questions
Q – 1 Explain What are the different types of PL/SQL program units that can be defined and stored in ORACLE database?
Ans- Procedures and Functions,Packages and Database Triggers.
Q – 2 Explain What are the differences between Database Trigger and Integrity constraints?
Ans- A declarative integrity constraint is a statement about the database that is always true. A constraint applies to existing data in the table and any statement that manipulates the table. A trigger does not apply to data loaded before the definition of the trigger, therefore, it does not guarantee all data in a table conforms to the rules established by an associated trigger.
A trigger can be used to enforce transitional constraints where as a declarative integrity constraint cannot be used.
Q – 3 Explain What is an Oracle Data Block?
Ans- ORACLE database’s data is stored in data blocks. One data block corresponds to a specific number of bytes of physical database space on disk.
Oracle database consists of logical storage place which is called as blocks and the bytes in a block is set through DB_BLOCK parameter in parameter file
Q – 4 Explain What is a Procedure?
Ans- A Procedure consist of a set of SQL and PL/SQL statements that are grouped together as a unit to solve a specific problem or perform a set of related tasks.
Procedure is pl/sql subprogram that can accept parameters and can be invoked form calling enviourment.Procedures are created to perform actions on an applications
Q – 5 Explain What are the uses of Oracle Rollback Segment?
Ans- Rollback Segments are used :
To generate read consistent database information during database recovery to rollback uncommitted transactions for users
Q – 6 Explain What is Database Trigger?
Ans- A Database Trigger is procedure (set of SQL and PL/SQL statements) that is automatically executed as a result of an insert in,update to, or delete from a table.
Q – 7 Explain What is a Package?
Ans- A Package is a collection of related procedures, functions, variables and other package constructs together as a unit in the database.
package is collection of logicaly related procedure,funtion,varialbles wich are stored all togther.Package implemnt the concept of Object orintation Encalsulatio,Datahiding andd polymorphism disadvantage of the package when a single function or procedure is called from package it also compiles all its related obejcts and get it store in SGA.
Q – 8 Explain the uses of Database Trigger?
Ans- Database triggers can be used to automatic data generation, audit data modifications, enforce complex Integrity constraints, and customize complex security authorizations.
Q – 9 Explain What are Oracle Schema Objects?
Ans- Schema objects are the logical structures that directly refer to the databases data.
Schema objects include tables, views, sequences, synonyms, indexes, clusters, database triggers, procedures, functions packages and database links.
Q – 10 Explain What is difference between Procedures and Functions?
Ans- A Function returns a value to the caller where as a Procedure does not.
Q – 11 Explain What are the advantages of having a Package?
Ans- Increased functionality (for example,global package variables can be declared and used by any proecdure in the package) and performance (for example all objects of the package are parsed compiled, and loaded into memory once)