PLSQL Interview Questions and Answers: Functions
PLSQL Interview Questions and Answers: Functions
1. What is the starting "oracle error number"? 2)What is meant by forward declaration
in functions?
2. Can Commit,Rollback ,Savepoint be used in Database Triggers?If yes than HOW? If no
Why?With Reasons
3. Can we declare a column having number data type and its scale is larger than pricesion ex:
column_name NUMBER (10,100), column_name NUMBAER(10,-84)
4. Explain how procedures and functions are called in a PL/SQL block ?
5. Explain the two type of Cursors ?
6. Explain the usage of WHERE CURRENT OF clause in cursors ?
7. Explian rowid,rownum?What are the pseduocolumns we have?
8. Give the structure of the function ?
9. Give the structure of the procedure ?
10. How many types of database triggers can be specified on a table ? What are they ?
11. How packaged procedures and functions are called from the following? a. Stored
procedure or anonymous block b. an application program such a PRC *C, PRO* COBOL c.
SQL *PLUS
12. How to avoid using cursors? What to use instead of cursor and in what cases to do so?
13. How to debug the procedure ?
14. How to disable multiple triggers of a table at at a time?
15. How we can create a table in PL/SQL block. insert records into it??? is it possible by some
procedure or function?? please give example...
16. How we can create a table through procedure ?
17. In a Distributed Database System Can we execute two queries simultaneously ? Justify ?
18. In pl/sql functions what is use of out parameter even though we have return statement.
19. Whar are Integarity Constraints?
20. Is it possible to use Transaction control Statements such a ROLLBACK or COMMIT
in Database Trigger ? Why ?
21. Name the tables where characteristics of Package, procedure and functions are stored ?
22. Open C1; Fetch c1 into Z; Commit; Fetch c1 in to Z; end;
23. State the advantage and disadvantage of Cursor?
24. State the difference between implicit and explicit cursor's.
25. What are % TYPE and % ROWTYPE ? What are the advantages of using these over
datatypes?
26. What are advantages fo Stored Procedures
27. What are the PL/SQL Statements used in cursor processing ?
28. What are the Restrictions on Cursor Variables?
29. What are the components of a PL/SQL Block ?
30. What are the cursor attributes used in PL/SQL ?
31. What are the datatypes a available in PL/SQL ?
32. What are the modes of parameters that can be passed to a procedure ?
33. What are the return values of functions SQLCODE and SQLERRM ?
34. What are the two parts of a procedure ?
35. What are two parts of package ?
36. What are two virtual tables available during database trigger execution ?
37. What happens if a procedure that updates a column of table X is called in a database trigger
of the same table ?
38. What is Overloading of procedures ?
39. What is PL/SQL ?
40. What is PL/SQL table ?
41. What is Pragma EXECPTION_INIT ? Explain the usage ?
42. What is Raise_application_error ?
43. What is a cursor ? Why Cursor is required ?
44. What is a cursor for loop ?
45. What is a database trigger ? Name some usages of database trigger ?
46. What is a stored procedure ?
47. What is an Exception ? What are types of Exception ?
48. What is difference between % ROWTYPE and TYPE RECORD ?
49. What is difference between a Cursor declared in a procedure and Cursor declared in a
package specification ?
50. What is difference between a PROCEDURE & FUNCTION ?
51. What is difference between stored procedures and application procedures,stored function
and application function?
52. What is pl/sql?what are the advantages of pl/sql?
53. What is ref cursor.
54. What is the basic structure of PL/SQL ?
55. What is trigger,cursor,functions in pl-sql and we need sample programs about it?
56. What will happen after commit statement ?
57. What will the Output for this Coding> Declare Cursor c1 is select * from emp FORUPDATE;
Z c1%rowtype; Begin
58. Where the Pre_defined_exceptions are stored ?
59. Write the order of precedence for validation of a column in a table ? I. done
using Database triggers. ii. done using
Your Ad Here
• How will you copy the structure of a table without copying the data?
• How to find out the database name from SQL*PLUS command prompt?
• Tadeoffs with having indexes
• Talk about "Exception Handling" in PL/SQL?
• What is the diference between "NULL in C" and "NULL in Oracle?"
• What is Pro*C? What is OCI?
• Give some examples of Analytical functions.
• What is the difference between "translate" and "replace"?
• What is DYNAMIC SQL method 4?
• How to remove duplicate records from a table?
• What is the use of ANALYZing the tables?
• How to run SQL script from a Unix Shell?
• What is a "transaction"? Why are they necessary?
• Explain Normalizationa dn Denormalization with examples.
• When do you get contraint violtaion? What are the types of constraints?
• How to convert RAW datatype into TEXT?
• Difference - Primary Key and Aggregate Key
• How functional dependency is related to database table design?
• What is a "trigger"?
• Why can a "group by" or "order by" clause be expensive to process?
• What are "HINTS"? What is "index covering" of a query?
• What is a VIEW? How to get script for a view?
• What are the Large object types suported by Oracle?
• What is SQL*Loader?
• Difference between "VARCHAR" and "VARCHAR2" datatypes.
• What is the difference among "dropping a table", "truncating a table" and "deleting all records" from a
table.
• Difference between "ORACLE" and "MICROSOFT ACCESS" databases.
• How to create a database link ?
PL/SQL interview questions...
• Normalize many to many relationships
• Difference - Equijoin and union
-- Sponsored Links --
Your Ad Here
-- Sponsored Links --
Your Ad Here
• Can one export to multiple files?/ Can one beat the Unix 2 Gig limit? (for DBA
• Can one import/export between different versions of Oracle? (for DBA
• Can one rename a database user (schema)?
• Can you have more than one content canvas view attached with a window?
• Can you pass data parameters to forms?
• Define Transaction ?
• Describe two phases of Two-phase commit ?
• Differentiate simple and complex, snapshots ?
• Do View contain Data ?
• Do a view contain data?
• Do user parameters appear in the data modal editor in 2.5?
• Does Oracle write to data files in begin/hot backup mode? (for DBA
• Does a Before form trigger fire when the parameter form is suppressed?
• Does a grouping done for objects in the layout editor affect the grouping done in the data model
editor?
• Does one need to drop/ truncate objects before importing? (for DBA
• EXIT_FORM is a restricted package procedure ?a. True b. False
• Explain about horizontal, Vertical tool bar canvas views?
• Explain about stacked canvas views?
• Explain the relationship among Database, Tablespace and Data file.?
• Explain the relationship among database, tablespace and data file.
• From which designation is it preferred to send the output to the printed?
• Give the sequence of execution of the various report triggers?
• How are extents allocated to a segment?
• How are the index updates?
-- Sponsored Links --
$5277 Profit in 12 Days
Forex Robot Earns More Money Than The Worlds 15 Best Traders Combined
Ads on AutoPilot
Automated advertising and list management system.
Your Ad Here
INDEX - Indexes help us retrieve data from tables quicker. Let's use an example to illustrate this point:
Say we are interested in reading about how to grow peppers in a gardening book. Instead of reading the
book from the beginning until we find a section on peppers, it is much quicker for us to go to the index
section at the end of the book, locate which pages contain information on peppers, and then go to these
pages directly. Going to the index first saves us time and is by far a more efficient method for locating the
information we need.
The same principle applies for retrieving data from a database table. Without an index, the database
system reads through the entire table (this process is called a 'table scan') to locate the desired
information. With the proper index in place, the database system can then first go through the index to
find out where to retrieve the data, and then go to these locations directly to get the needed data. This is
much faster.
Therefore, it is often desirable to create indexes on tables. An index can cover one or more columns. The
syntax for creating a table index is shown in the CREATE INDEX section. Below we discuss some
general strategies when building and using an index:
1. Build index on columns of integer type
Integers take less space to store, which means the query will be faster. If the column you want to build an
index for is not of type integer, consider creating a surrogate integer key (or simply a surrogate column of
type integer) which maps one-to-one to the column you want to build the index for.
2. Keep index as narrow as possible
Narrower indexes take less space, require less time to process, which in turn means the query will run
faster.
3. Column order is important
For indexes covering multiple columns, the order of the columns in the index is important. The best
practice is to use the column with the lowest cardinality first, and the column with the highest cardinality
last. Recall cardinality means the number of distinct values for that column. So, if "SELECT DISTINCT
(COLUMN1) FROM TABLE_NAME;" returns 5, that means the cardinality for COLUMN1 is 5.
4. Make sure the column you are building an index for is declared NOT NULL
This can decrease the size of the index, which in turn will speed up the query.
VIEW – A view is a virtual table. A view consists of rows and columns just like a table. The difference
between a view and a table is that views are definitions built on top of other tables (or views), and do not
hold data themselves. If data is changing in the underlying table, the same change is reflected in the view.
A view can be built on top of a single table or multiple tables. It can also be built on top of another view. In
the SQL Create View page, we will see how a view can be built.
Views offer the following advantages:
1. Ease of use: A view hides the complexity of the database tables from end users. Essentially we can
think of views as a layer of abstraction on top of the database tables.
2. Space savings: Views takes very little space to store, since they do not store actual data.
3. Additional data security: Views can include only certain columns in the table so that only the non-
sensitive columns are included and exposed to the end user. In addition, some databases allow views to
have different security settings, thus hiding sensitive data from prying eyes.