What is the condition to be follwed for the natural join syntax to be correct??

Showing Answers 1 - 10 of 10 Answers

AyanM

  • Jul 11th, 2006
 

While performing Natural Join please ensure that the name of the common column of both the tables are identical and their data types are also the same.

  Was this answer useful?  Yes

inxs92

  • Nov 7th, 2006
 

the column names need not be identical but the data types of the column names should be identical

like

select e.empno,d.deptno from emp e,dept d where e.dept_no = d.deptno;

  Was this answer useful?  Yes

It implicitly construct the join condition on the 2 tables taking all the column with same name into consideration.Natural join is also called blind join.

select  employee_id,last_name,department_name from employees natural join departments;

  Was this answer useful?  Yes

A natural join will join two datasets on all matching column names, regardless of whether the columns are actually related in anything other than name.

SELECT d.dname, d.loc, e.ename, e.job FROM dept d NATURAL JOIN emp e;

We cannot alias any columns used in the natural join,whose column name is same.

SELECT d.deptno FROM dept d NATURAL JOIN emp e;

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions