Friday, May 23, 2008

SQL PL/SQL Interview Questions 4

16 What is a join and explain different types of joins.
A: Joins are used in queries to explain how different tables are related.
Joins also let you select data from a table depending upon data from another
table.
Types of joins: INNER JOINs, OUTER JOINs, CROSS JOINs. OUTER JOINs are further
classified as LEFT OUTER JOINS, RIGHT OUTER JOINS and FULL OUTER JOINS.

17: What is a self join?
A: Self join is just like any other join, except that two instances of the
same table will be joined in the query.

18: What are triggers? How to invoke a trigger on demand?
A: Triggers are special kind of stored procedures that get executed automatically when an INSERT, UPDATE or DELETE operation takes place on a table.
Triggers can't be invoked on demand. They get triggered only when an associated action (INSERT, UPDATE, DELETE) happens on the table on which they are defined.
Triggers are generally used to implement business rules, auditing. Triggers can also be used to extend the referential integrity checks, but wherever possible, use constraints for this purpose, instead of triggers, as constraints are much faster.

19: What is a join and explain different types of joins.
A: Joins are used in queries to explain how different tables are related. Joins also let you select data from a table depending upon data from another table.
Types of joins: INNER JOINs, OUTER JOINs, CROSS JOINs. OUTER JOINs are further classified as LEFT OUTER JOINS, RIGHT OUTER JOINS and FULL OUTER JOINS.

20: What is a self join?
A: Self join is just like any other join, except that two instances of the same table will be joined in the query.

No comments:

Useful Information