if we want to retrive data from more than one table byusing join conditions then we go to join based on the type type of join condition.
sub query is nested quires there is no need of any join condition

2 Users have rated as useful.
Login to rate this answer.
Join is a Methodology to get a data from more than one table, its work under the condition.
Example:
If we want to display the Employee no and his Department no
SELECT Empno,Deptno
FROM Emp,Dept
where Emp.Deptno=Dept.Deptno
subquery it has two select statement, the inner select statement will execute first and then it will be the value for outer select statement.
Example:
If we want to display the employees who are getting salary more than an employee TIM
SELECT Ename,Sal
FROM Emp
WHERE Sal>(SELECT Sal
FROM Emp
WHERE Ename='TIM');
Login to rate this answer.
abdullah
Answered On : Sep 12th, 2011
I am software engineer and iam working on oracle mysql and sql so i have lot of experience on this ,basically joins are using there should be connection two or more than two tables ,joins are always occurs where each tables has relation with other tables and these are linear relation should be necessary while sub query and child query means query inside query no need to relation it works on columns and conditions like ,if you want to retrieve the name of employee who has salary more than two thousand then sub query will use very beneficial and sub quires ,A subquery is a query that is nested inside a SELECT, INSERT, UPDATE, or DELETE statement, or inside another subquery. A subquery can be used anywhere an expression is allowed. In this example a subquery is used as a column expression named MaxUnitPrice in a SELECT statement.
Login to rate this answer.
Hiren
Answered On : Nov 29th, 2011
Its true,
I would like to add some more information about it,
Subquery take separate temp table and checking condition ..
Besides join is checks conditions first and then put it into table and displays as we mentioned.
If our tables has got big amount of data than, during the execution, subquery takes more load and hence more time as well.
So, its more convenient to use join instead of subquery.
Good luck.
Login to rate this answer.