Correct Answer: A database trigger is procedural code that is automatically executed in response to certain events on a particular table or view in a database The trigger is mostly used for maintaining the integrity of the information on the database Syntax: CREATE OR REPLACE TRIGGER [Trigger Name] [Before / After / Instead Of] ON [schema][table] Types of PL/SQL triggers : > Row trigger - The trigger fires for each ROW affected > Statement trigger - The trigger is fired once when the condition is matched > Before and After trigger - The BEFORE trigger run the trigger action before the insert, update or delete statement The AFTER trigger runs the trigger action after the insert, update or delete statement is executes
5. What are PL/SQL Subprograms? What are its Advantages ?
Correct Answer: Named PL/SQL blocks of code which can be invoked using parameters are called PL/SQL sub programs Advantages of PL/SQL subprograms are - The application makes a single call to the database to run a block of statements which improves performance against running SQL multiple times This will reduce the number of calls between the database and the application - PL/SQL is secure since the code resides inside the database thus hiding internal database details from the application The application will only make a call to the PL/SQL sub program - PL/SQL and SQL go hand in hand so there would be no need of any translation required between PL/SQL and SQL
6. What is the maximum number of Triggers can be applied in a table ?
Correct Answer: PATH and CLASSPATH are operating system level environment variables PATH is used to define where the system can find the executables (exe) files whereas CLASSPATH is used to specify the location of class files
Correct Answer: The variable should be declared as static and final So only one copy of the variable exists for all instances of the class and the value can't be changed also static final int PI = 214; is an example for constant
10. What is the access scope of a protected method?