Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 14-05-2009
Member
 
Join Date: Feb 2009
Posts: 123
Equi Join vs Natural Join in SQL

There is something called Equi Join in SQL. Is it different from the Join operation we normally perform in SQL ? I want to know what is the difference between equi join and the natural join? Which join option is better ?
Can anyone help me with this......thanks
Reply With Quote
  #2  
Old 14-05-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: Equi Join vs Natural Join in SQL

In SQL, there are following categories for Join operations -
  • Inner Joins
  • Outer Joins
  • Subtract Joins
  • Full Outer Joins
  • Self Joins
  • Equi-Joins
  • Natural Joins
  • Cartesian Products

For detailed information on each of the above join operations,
visit the following microsoft site - http://support.microsoft.com/kb/136699
Reply With Quote
  #3  
Old 14-05-2009
Member
 
Join Date: May 2008
Posts: 2,383
Re: Equi Join vs Natural Join in SQL

For Equi join, you need to specify columns which you want to put equi join
For Example :
SQL> select dpt.dptno from dept join emp on emp.dptno=dpt.dptno;

whereas

For natural join, you dont need to specify column names for the join – it will automatically join same name columns in two different tables
For Example :
SQL> select dptno from dept natural join emp;
Reply With Quote
  #4  
Old 14-05-2009
Member
 
Join Date: Jan 2008
Posts: 1,515
Re: Equi Join vs Natural Join in SQL

SQL Joins acan be classified into - EQUI Join and NON-EQUI Join

EQUI Join -
It is a sql join condition which uses the equal sign as the comparison operator. An equi-join is further classified into two categories:
a) SQL Inner Join
b) SQL Outer Join

In SQL Inner Join, all the rows returned by the sql query satisfy the sql join condition specified.

In SQL Outer Join, it returns all rows from both tables which satisfy the join condition along with rows which do not satisfy the join condition from one of the tables.

NON-EQUI Join -
A Non Equi Join is a SQL Join whose condition is established using all comparison operators except the equal (=) operator. (>=, <=, <, >).
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Equi Join vs Natural Join in SQL"
Thread Thread Starter Forum Replies Last Post
Can?t join friends in Max Payne 3, error "Join Failed Failure: Blacklisted. G.Kahli Video Games 3 02-06-2012 12:44 PM
How to re-join all partitions on HDD tester22 Operating Systems 2 08-10-2009 11:23 PM
Too many rows after Join in SQL Elkanah Software Development 2 24-03-2009 02:11 PM
Join in SQL Ettan Software Development 1 10-11-2008 01:45 PM


All times are GMT +5.5. The time now is 03:07 PM.