PL/SQL MULTIPLE CHOICE QUESTION.

Slides:



Advertisements
Similar presentations
PL/SQL.
Advertisements

SQL*PLUS, PLSQL and SQLLDR Ali Obaidi. SQL Advantages High level – Builds on relational algebra and calculus – Powerful operations – Enables automatic.
A Guide to Oracle9i1 Advanced SQL And PL/SQL Topics Chapter 9.
Copyright  Oracle Corporation, All rights reserved. 4 Creating Functions.
PL/SQL Bulk Collections in Oracle 9i and 10g Kent Crotty Burleson Consulting October 13, 2006.
Bordoloi and Bock CURSORS. Bordoloi and Bock CURSOR MANIPULATION To process an SQL statement, ORACLE needs to create an area of memory known as the context.
PL / SQL P rocedural L anguage / S tructured Q uery L anguage Chapter 7 in Lab Reference.
SAGE Computing Services Customised Oracle Training Workshops and Consulting Are you making the most of PL/SQL? Hints and tricks and things you may have.
Lecture 4 PL/SQL language. PL/SQL – procedural SQL Allows combining procedural and SQL code PL/SQL code is compiled, including SQL commands PL/SQL code.
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 7 PL/SQL Packages.
INTRODUCTION TO PL/SQL. Class Agenda Introduction Introduction to PL/SQL Declaring PL/SQL Variable Creating the Executable Section Interacting with the.
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 6 Functions.
PL/SQLPL/SQL Oracle11g : PL/SQL Programming Chapter 6 Functions.
Overview · What is PL/SQL · Advantages of PL/SQL · Basic Structure of a PL/SQL Block · Procedure · Function · Anonymous Block · Types of Block · Declaring.
1. 1. Which type of argument passes a value from a procedure to the calling program? A. VARCHAR2 B. BOOLEAN C. OUT D. IN 2.
In Oracle.  A PL/SQL block stored in the database and fired in response to a specified event ◦ DML statements : insert, update, delete ◦ DDL statements.
Using Procedures & Functions Oracle Database PL/SQL 10g Programming Chapter 9.
Lecture 8 Creating Stored Functions. Objectives  After completing this lesson, you should be able to do the following:  What is Function?  Types of.
PRACTICE OVERVIEW PL/SQL Part Examine this package specification and body: Which statement about the V_TOTAL_BUDGET variable is true? A. It must.
8 1 Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
Chapter 15 Introduction to PL/SQL. Chapter Objectives  Explain the benefits of using PL/SQL blocks versus several SQL statements  Identify the sections.
What is a Package? A package is an Oracle object, which holds other objects within it. Objects commonly held within a package are procedures, functions,
Objectives Database triggers and syntax
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 9 Database Triggers.
Chapter 9: Advanced SQL and PL/SQL Guide to Oracle 10g.
Dynamic SQL. 2 home back first prev next last What Will I Learn? Recall the stages through which all SQL statements pass Describe the reasons for using.
Oracle10g Developer: PL/SQL Programming1 Objectives SQL queries within PL/SQL Host or bind variables The %TYPE attribute Include queries and control structures.
A Guide to SQL, Eighth Edition Chapter Eight SQL Functions and Procedures.
PL/SQLPL/SQL Oracle11g: PL/SQL Programming Chapter 9 Database Triggers.
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 9 Database Triggers.
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 8 Program Unit Dependencies.
Chapter 5 : Integrity And Security  Domain Constraints  Referential Integrity  Security  Triggers  Authorization  Authorization in SQL  Views 
Professor: Dr. Shu-Ching Chen TA: Hsin-Yu Ha Function, Trigger used in PosgreSQL.
A procedure is a module performing one or more actions; it does not need to return any values. The syntax for creating a procedure is as follows: CREATE.
PRACTICE OVERVIEW PL/SQL Part Your stored procedure, GET_BUDGET, has a logic problem and must be modified. The script that contains the procedure.
Oracle10g Developer: PL/SQL Programming1 Objectives Named program units How to identify parameters The CREATE PROCEDURE statement Creating a procedure.
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
Oracle9i Developer: PL/SQL Programming Chapter 5 Functions.
Kingdom of Saudi Arabia Ministry of Higher Education Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences Overview.
1 Chapter 5: Advanced PL/SQL Programming. 2 Anonymous PL/SQL Programs Write code in text editor, execute it in SQL*Plus Code can be stored as text in.
Oracle9i Developer: PL/SQL Programming Chapter 6 PL/SQL Packages.
Preface IIntroduction Course Objectives I-2 Oracle Complete Solution I-3 Course Agenda I-4 Tables Used in This Course I-5 The Order Entry Schema I-6 The.
1 Copyright © 2004, Oracle. All rights reserved. PL/SQL Programming Concepts: Review.
6 Copyright © 2009, Oracle. All rights reserved. Using Dynamic SQL.
Creating Stored Functions
Pl/SQL LANGUAGE MULITPLE CHOICE QUESTION SET-3
Creating Database Triggers
Chapter 8 Dependencies, Privileges and Compilation Oracle11g:
Active Database Concepts
PL/SQL LANGUAGE MULITPLE CHOICE QUESTION SET-1
PL/SQL.
Introduction to Triggers
PL/SQL MULTIPLE CHOICE QUESTION.
Introduction to Triggers
Chapter 7 Program Unit Dependencies Oracle9i Developer:
PL/SQL Package Week 8.
PL/SQL Scripting in Oracle:
PRACTICE OVERVIEW PL/SQL Part - 2.
Chapter 2 Handling Data in PL/SQL Blocks Oracle9i Developer:
Introduction to Triggers
Chapter 7 Using SQL in Applications
Oracle9i Developer: PL/SQL Programming Chapter 8 Database Triggers.
Chapter 7 Using SQL in Applications
PRACTICE OVERVIEW PL/SQL Part - 1.
Chapter 8 Advanced SQL.
PL/SQL Declaring Variables.
Prof. Arfaoui. COM390 Chapter 9
Prof. Arfaoui. COM390 Chapter 6
Prof. Arfaoui. COM390 Chapter 7
Presentation transcript:

PL/SQL MULTIPLE CHOICE QUESTION

Check your Knowledge Press to Start www.prolearninghub.com

1. Where can a BULK COLLECT clause are used? SELECT INTO statement and FETCH statement RETURNING INTO clause and SELECT INTO statement FORALL statement and SELECT INTO statement SELECT INTO statement, RETURNING INTO statement and FETCH statement www.prolearninghub.com

2. Which of the following in incorrect regarding the FORALL statement? FORALL sends DML statements from PL/SQL to SQL in batches rather than one at a time. FORALL tells the PL/SQL runtime engine to bulk bind into the SQL statement all the elements of one or more. collections before sending anything to the SQL engine FORALL statement is a FOR LOOPFORALL statement contains an iteration scheme www.prolearninghub.com

3. What does the lower bound and upper bound of FORALL statement indicate? They are numbers implicitly assigned by the PL/SQL engine They must specify a valid range of consecutive index numbers for the variables referenced in the SQL statement. They must be constant numbers explicitly assigned They must specify a valid range of consecutive index numbers for the collection referenced in the SQL statement. www.prolearninghub.com

4. Which of the following is the correct syntax to use BULK COLLECT with SELECT INTO statement? SELECT column_names BULK COLLECT INTO collection_type FROM table_name SELECT column_names INTO BULK COLLECT collection_type FROM table_name SELECT BULK column_names COLLECT INTO collection_type FROM table_name SELECT BULK COLLECT column_names INTO collection_type FROM table_name www.prolearninghub.com

5. Into which of the following type of variables do all BULK operations in PL/SQL fetch data? Scalar Collection Records User defined types www.prolearninghub.com

6. An internal LOB is: A column that is a primary key A table Stored in database A file stored outside of a database www.prolearninghub.com

7. You need to implements a virtual private database 7.You need to implements a virtual private database. In order to have the vpd functionality, a trigger is required to fire when every user initiate a session in the database. What type of trigger need to be created? DML triggers INSTEAD OF trigger System event trigger Application Trigger www.prolearninghub.com

8. The old and new qualifier can be used in which type of triggers? Row Level DML triggers Row Level DML triggers Statement level DML triggers Row level application triggers www.prolearninghub.com

9. Which view displays indirect independencies, indenting each dependency? DEPTREE IDEPTREE INDENT_TREE I_DEPT_TREE www.prolearninghub.com

10. Which two dopes the INSTEAD OF clause in a trigger identify 10. Which two dopes the INSTEAD OF clause in a trigger identify? 1) The view associated with the trigger 2) The event associated with trigger 3) The table associated with trigger 4) The package associated with trigger 1;2 2;4 1;3 3;4 www.prolearninghub.com

11. Which three are valid ways to reduce the dependency failure 11. Which three are valid ways to reduce the dependency failure? 1) Querying with SELECT* notification 2) Specifying schema names when referencing object 3) Declaring records by using %ROWTYPE attribute 4) Declaring variable with % TYPE attribute 1;2;3 2;3;4 1;3;4 1;2;4 www.prolearninghub.com

12. How can you migrate from a LONG to a LOB data type for a column? Use the DBMS_MANAGE_LOB.MIGRATE procedure Use the UTL_MANAGE_LOB.MIGRATE procedure Use the DBMS_LOB.MIGRATE procedure Use the ALTER TABLE command www.prolearninghub.com

13. You need to remove database trigger REMOVE_HOUR which command do you use to remove the trigger in the SQL*plus environment? DROP_TRIGGER business_hour; DELETE_TRIGGER business_hour; REMOVE_TRIGGER business_hour; ALTER_TRIGGER business_hour REMOVE; www.prolearninghub.com

14. You are about to change the arguments of the CALC_TEAM_AVG function. Which dictionary view can you query to determine the name of the procedure of the function that invokes the CALC_TEAM_AVG function? USER_PROC_DEPENDS USER_REFERENCES USER_DEPENDENCIES USER SOURCE www.prolearninghub.com

15. You can create DML trigger for the timing information, which is valid with a DML trigger? ON SHUTDOWN DURING INSTEAD BEFORE www.prolearninghub.com

16. You want to create a PL/SQL block of code that calculates the discount on customer’s orders. This code will invoke from several places, but only within a program unit ORDERTOTAL. What is the most appropriate location to store the code that calculates the discount? A stored procedure on the server A standalone procedure on client machine A block of code in PL/SQL library A local subprogram defined within the program unit ORDERTOTAL www.prolearninghub.com

17. Which statement about the trigger is true? You use an application trigger to fire when a DELETE statement occur You use an database trigger to fire when a INSERT statement occur You use an event trigger to fire when a UPDATE statement occur You use an INSTEAD OF trigger to fire when a SELECT statement occur www.prolearninghub.com

18. Which four triggering events can cause a trigger to fire? A specific error and an error occur A database is shutdown or on startup A specific user on any user log on or off Al of these www.prolearninghub.com

19. Which four triggering events can cause a trigger to fire? A specific error and an error occur A database is shutdown or on startup A specific user on any user log on or off All of these www.prolearninghub.com

A value equal to the no of rows in the emp table Examine the code: CREATE OR REPLACE TRIGGER update_emp AFTER UPDATE ON Emp BEGIN INSERT INTO audit_table(who, dated) VLAUES (USER, SYSDATE); END; You issue an UPDATE command in the emp table that result in change 10 rows. 20. How many rows are inserted into the AUDIT_TABLE? 1 10 None A value equal to the no of rows in the emp table www.prolearninghub.com

21. Which table should you query to determine when you procedure was last compiled? USER_PROCEDURES USER_PROCS USER_OBJECTS USER_PLSQL_UNITS www.prolearninghub.com

22. Which part of the database trigger determines the number of time the trigger body executes? Trigger type Trigger body Trigger event Trigger timing www.prolearninghub.com

23. Which statements are true 23. Which statements are true? (Choose all that apply) 1) If error occur during the compilation of a trigger, the trigger is still created 2) If error occur during the compilation of a trigger, use the SHOW ERROR command within ISQL *PLUS to see the compilation error 3) If error occur during the compilation of a trigger, you can go in the SQL*plus and query the USER ERROR PLUS to see the compilation error 4) If error occur during the compilation of a trigger, you can go in the SQL*plus and query the USER_TRIGGER data dictionary to the see the compilation errors 1;2;3 2;3;4 1;3;4 1;2;4 www.prolearninghub.com

24. you need to create a trigger on the emp table that monitors every row that is changed and place this info into a table AUDIT_TABLE what type of trigger do you create ? FOR EACH ROW trigger on the emp table Statement-level trigger on the emp table FOR EACH ROW trigger on the AUDIT_TABLE Statement-level trigger on the AUDIT_TABLE www.prolearninghub.com

25. Which two statements describe the state of a package variable after executing the package in which it is described? It persist across transaction within a session It persist from session to session for the same user It does not persist within a table It persist from user to user when the package invoked www.prolearninghub.com

26. Which two programming construct used to group within a package 26. Which two programming construct used to group within a package? 1) Cursors 2) Constant 3) View 4) Trigger 1;2 1;3 2;3 3;4 www.prolearninghub.com

27. The number of cascading trigger is limited by which database initialization parameter? CASCADE_TRIGGER_CNT OPEN_CURSORS OPEN TRIGGERS OPEN_DB_TRIGGERS www.prolearninghub.com

Substitution variables 28. When creating stored procedure and functions which construct allow you to pass values to and from the calling environment? Local variables Arguments Boolean variables Substitution variables www.prolearninghub.com

29. You need to remove database trigger BUSINESS_RULE 29. You need to remove database trigger BUSINESS_RULE. Which command do you use to remove the trigger in SQL*PLUS environment? DROP TRIGGER business_rule; DELETE TRIGGER business_rule; REMOVE TRIGGER business_rule; ALTER TABLE business_rule; www.prolearninghub.com

30. Which two trigger are fused track object dependencies 30. Which two trigger are fused track object dependencies? 1) USER_DEPENDENCIES 2) IDEPTREE 3) USER_IDEPTREE 4) USER_DEPTREE 1;2 3;4 2;4 1;4 www.prolearninghub.com

31. Which type of arguments pass a value from a calling environment? VARCHAR2 BOOLEAN OUT IN www.prolearninghub.com

32. Which statement about the local dependant object is TRUE? They are on different nodes They are on different databases They are on the same nodes in the same database They are on the same nodes in different database www.prolearninghub.com

33. Under which condition do you create a server side procedure? When the procedure contains no SQL statements When the procedure contains no SQL procedure When procedure need to be used by many client application accessing several remote database When procedure need to be used by many users accessing the same schema objects on the local database www.prolearninghub.com

34. Which oracle supply package allows you to run jobs at user define times? DBMS_JOB DBMS_RUN DBMS_PIPE DBMS_SQL www.prolearninghub.com

35. You need to drop a table within a store procedure 35. You need to drop a table within a store procedure. How do you implement this? You cannot drop a procedure from a stored procedure Use the DROP command Use the DBMS_DDL packaged routines Use the DBMS_DROP package routines www.prolearninghub.com

36. Which kind of package variable is V_MAX_TEAM_SALARY? Private Public In Out www.prolearninghub.com

37. You want to send a message to another session connected to same instance. Which oracle supplied package did you use? DBMS_PIPE DBMS_JOB DBMS_OUTPUT DBMS_MESSAGE www.prolearninghub.com

38. Which system of privileges must you have to manually compile a stored procedure owned by another application developer? ALTER PROCEDURE ALTER ANY PROCEDURE ALTER ALL PROCEDURE COMPILE ANY PRO CEDURE www.prolearninghub.com

Executable and exception handling 39. When creating a function in which section will, you typically find a return keyword? Header only Declarative Executable and header Executable and exception handling www.prolearninghub.com

40. Which compiler directive to check the purity level of functions? PRAGMA_SECURITY_LEVEL PRAGMA_SECURITY_REUSABLE PRAGMA_RESTRICT_PREFERENCES PRAGMA_RESTRICT_PURITY_LEVEL www.prolearninghub.com

41. How many public procedure are there in the MANAGE_EMPS package? 2 3 4 www.prolearninghub.com

42. What happens during the parse phrase with dynamic SQL? Rows are selected and ordered The numbers of rows proceed is returned The validity of the SQL statement is established An area d memory is established to process the SQL statement www.prolearninghub.com

43. Which script file must be executed before you can determine indirect independencies using the DEPTREE and INDEPTREE VIEWES? UTL_IDEPT.SQL UTLIDD.SQL UTLIDD.SQL UTLDTREE.SQL www.prolearninghub.com

44. Which two statements are true 44. Which two statements are true? 1) A function must return a value 2) A procedure must returns a value 3) A function execute PL/SQL statement 4) A function is invoked as a part of an expression 1;2 3;4 2;4 1;4 www.prolearninghub.com

45. Which of the following statements are true about the LOB? LOB is a database object LOB represents a datatype that is used to store large, unstructured data. LOB can be store inside or out of a database Internal LOB is a category of LOB www.prolearninghub.com

46. Which of the following ORACLE supplied package is used to enable HTTP callouts from PL/SQL and SQL to access the data on the internet? DBMS_DDL UTL_HTTP UTL_SMTP UTL_URL www.prolearninghub.com

47. If there is any chance applied to a package specification or body of a stored subprogram which statement is true about it? Package specification only requires recompilation Package body only requires recompilation Both package and body requires recompilation Both package and body does not requires recompilation www.prolearninghub.com

48. All objects placed in a package specification are called Public objects. Private objects. None of the above. Both of the above. www.prolearninghub.com

49. The collection method LAST Returns the last (largest) index numbers in a collection that uses integer subscripts. Returns the number of elements that a collection currently contains. Checks the Maximum Size of a Collection. None of the above. www.prolearninghub.com

50. Which of the following is not true about object oriented PL/SQL? It helps in designing object-oriented database in Oracle. An object type allows you to crate composite types. Objects are created using the CREATE [OR REPLACE] CLASS statement. None of the above. www.prolearninghub.com

The Results