PL/SQL
1. What is a View? (PL/SQL)
Ans
A view is a virtual table which consists of a subset of data contained in a table.
Views are not virtually present, and it takes less space to store.
View can have data of one or more tables combined, and it is depending on the
relationship.
2. What is an Index?(PL/SQL)
Ans
An index is performance tuning method of allowing faster retrieval of records
from the table. An index creates an entry for each value and it will be faster to
retrieve data.
3. What are all the different types of indexes?(PL/SQL)
Ans
There are three types of indexes
Unique Index
This indexing does not allow the field to have duplicate values if the column
is unique indexed. Unique index can be applied automatically when
primary key is defined.
Clustered Index
This type of index reorders the physical order of the table and search based
on the key values. Each table can have only one clustered index.
Non Clustered Index
Non Clustered Index does not alter the physical order of the table and
maintains logical order of data. Each table can have 999 non clustered
indexes.
4. What is a Cursor?(PL/SQL)
PL/SQL 1
Ans
A database Cursor is a control which enables traversal over the rows or records
in the table. This can be viewed as a pointer to one row in a set of rows.
Cursor is very much useful for traversing such as retrieval, addition and removal
of database records.
5. What is a stored procedure?(PL/SQL)
Ans
Stored Procedure is a function consists of many SQL statement to access the
database system. Several SQL statements are consolidated into a stored
procedure and execute them whenever and wherever required.
6. What is a trigger?(PL/SQL)
Ans
A DB trigger is a code or programs that automatically execute with response to
some event on a table or view in a database. Mainly, trigger helps to maintain
the integrity of the database.
Example: When a new student is added to the student database, new records
should be created in the related tables like Exam, Score and Attendance tables.
7. What is the difference between Cluster and Non-Cluster Index? (PL/SQL)
Ans
Clustered index is used for easy retrieval of data from the database by altering
the way that the records are stored. Database sorts out rows by the column
which is set to be clustered index.
A non clustered index does not alter the way it was stored but creates a
complete separate object within the table. It point back to the original table rows
after searching.
8. Advantages and Disadvantages of Stored Procedure? (PL/SQL)
Ans
Stored procedure can be used as a modular programming û means create
once, store and call for several times whenever required. This supports faster
PL/SQL 2
execution instead of executing multiple queries. This reduces network traffic
and provides better security to the data.
PL/SQL 3