ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Databases  >>  SQL PLSQL
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
What are the different types of joins and explain them 
briefly.
 Question Submitted By :: Mreddy
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What are the different types of joins and explain them briefly.
Answer
# 1
equi join ,
non-equi join,
self join,
outer join,
cross join.
 
Is This Answer Correct ?    1 Yes 0 No
Hindol
 
  Re: What are the different types of joins and explain them briefly.
Answer
# 2
There are 2 main type of joins :
Equijoin : Join N number of tables for equality =.
Non-Equijoin : Join N number of tables for other than
equality such as <>,<,>,IN,BETWEEN etc.

Technically there are total 3 different types of joins:
Cross Join: When join condition is missing then all rows
from one table gets joined with all rows from other table..
Inner Join: If a row has a NULL value in any one of the
columna of join conditin then that row will not fetched.
Outer Join: Even if the NULL values are present in any
columns of join condition that record will get fetched.
There are again 3 types of outer joins: Left, Right, Full.
Self Join : A table is joined with self.
 
Is This Answer Correct ?    1 Yes 0 No
Rahul Koshti
 
 
 
  Re: What are the different types of joins and explain them briefly.
Answer
# 3
Joins in Oracle 10g :
---------------------

A join is a query that combines rows from two or more 
tables, views, or materialized views ("snapshots"). Oracle 
performs a join whenever multiple tables appear in the 
query's FROM clause. The query's select list can select any 
columns from any of these tables. If any two of these 
tables have a column name in common, you must qualify all 
references to these columns throughout the query with table 
names to avoid ambiguity.

Join Conditions
---------------
Most join queries contain WHERE clause conditions that 
compare two columns, each from a different table. Such a 
condition is called a join condition. To execute a join, 
Oracle combines pairs of rows, each containing one row from 
each table, for which the join condition evaluates to TRUE. 
The columns in the join conditions need not also appear in 
the select list.

To execute a join of three or more tables, Oracle first 
joins two of the tables based on the join conditions 
comparing their columns and then joins the result to 
another table based on join conditions containing columns 
of the joined tables and the new table. Oracle continues 
this process until all tables are joined into the result. 
The optimizer determines the order in which Oracle joins 
tables based on the join conditions, indexes on the tables, 
and, in the case of the cost-based optimization approach, 
statistics for the tables.

In addition to join conditions, the WHERE clause of a join 
query can also contain other conditions that refer to 
columns of only one table. These conditions can further 
restrict the rows returned by the join query.

Equijoin / Inner Join
---------------------

An equijoin is a join with a join condition containing an 
equality operator. An equijoin combines rows that have 
equivalent values for the specified columns.

Cartesian Product
-----------------
If two tables in a join query have no join condition, 
Oracle returns their Cartesian product. Oracle combines 
each row of one table with each row of the other. A 
Cartesian product always generates many rows and is rarely 
useful. For example, the Cartesian product of two tables, 
each with 100 rows, has 10,000 rows. Always include a join 
condition unless you specifically need a Cartesian product. 
If a query joins three or more tables and you do not 
specify a join condition for a specific pair, the optimizer 
may choose a join order that avoids producing an 
intermediate Cartesian product.

Outer Join
----------

An outer join extends the result of a simple join. An outer 
join returns all rows that satisfy the join condition and 
those rows from one table for which no rows from the other 
satisfy the join condition. Such rows are not returned by a 
simple join. To write a query that performs an outer join 
of tables A and B and returns all rows from A, apply the 
outer join operator (+) to all columns of B in the join 
condition. For all rows in A that have no matching rows in 
B, Oracle returns NULL for any select list expressions 
containing columns of B. 

Outet join has Two types :
--------------------------
1. Left Outer Join
2. Right Outer Join

Self Join
---------

A self join is a join of a table to itself. This table 
appears twice in the FROM clause and is followed by table 
aliases that qualify column names in the join condition. To 
perform a self join, Oracle combines and returns rows of 
the table that satisfy the join condition.
 
Is This Answer Correct ?    0 Yes 0 No
Selvaraj V, Anna University
 

 
 
 
Other SQL PLSQL Interview Questions
 
  Question Asked @ Answers
 
write a query to display diference between two dates in sql server  2
HOW TO APPEAR FOR ONLINE EXAMS OF SQL & PL/SQL? WHICH BOOKS WILL BE BETTER FOR REFERENCE TO QUALIFY THESE EXAMS? ARE THERE ANY MODEL PAPERS AVAILABLE IN THE MARKET ABOUT SQL & PLSQL?  1
In a package if we have 10 procedures or functions,How to know which will execute first?  1
Explain how procedures and functions are called in a PL/SQL block ?  2
I have one Excel file with 1,50,000 Records. Now I need to load that whole file into Oracle Database with same columns in Excel sheet . I need PLSQL Procedure or used by SQL PLUS Polaris2
what is ref cursor in pl/sql?  3
can we create index on index? iFlex4
How you will create Toad Function?  1
What are the types of triggers ? TCS8
What is PL/SQL table ?  3
I have a Employee table with columns ename,eid,salary,deptno. How to retrieve sum of salary for each deptno? L&T4
Which one of the following is a reason that an INSERT statement might cause an error instead of executing correctly? 1. The INSERT statement was attempting to insert a record into a view that was created from more than one table. 2. The INSERT statement was attempting to insert a record using a combination of constants and values from an existing table. 3. The INSERT statement was attempting to insert a record with a non-NULL value into a table that has that column defined as NULL. 4. The INSERT statement was attempting to insert a record into a table by selecting a record from that same table. 5. The INSERT statement was attempting to insert a record into a view rather than a table. Sonata1
Give the structure of the function ?  1
what is the difference between to_char and to_date functions? Infosys3
what is purge command explain about oracle performance tuning Accenture2
what is variable in package specification  2
four procedures is are there should i write their in a package  2
when a procedure /package is getting invalidated? TCS4
What is normalization and types of normalization? Microsoft5
scope of exception handling in plsql Wipro3
 
For more SQL PLSQL Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com