their should be a relationship between the tables then only
we can use join conditions....
But the subquery can be used to retrive data from one or
more table if their is no relation between the tables....
Majorly subqueries run independently and result of the
subquery used in the outer query(other than corelated subquery).
And in case of join a query only give the result when the
joining condition gets satisfied.
Join:
It is the method of joining one or more tables together and
finding a answer.
Sub Query:
It is a method of finding one answer using another query.
Main Difference:
In join both the tables should have a comman column name
but in subquery without having a column name we can execute
the query.
Join:
It is the machanism of joining one or more tables together
and finding information from one or all tables used in join.
Sub Query:
It is a method of finding answer using another query as
parametere for first query.
Main Difference:
In join both the tables should have a comman column type
but in subquery without having a column type we can execute
the query.
Sub Query:
The Sub Query only get the results as one table or the
other table based that the result be of onther table as
used in the table.
The two tables information are dispalyed as combiend.
Join:
To get results more rhan two tables information.
their should be a relationship between the tables then only
we can use join conditions....
But the subquery can be used to retrive data from one or
more table if their is no relation between the tables....
The main difference between join and sub query is :
join is used to retrieve data from two different tables
where as in sub query we can retreive data from one table
using the result of the where condition on another table.
the main diff is
the subquery gives the result from one table only,but whose condition may depend on another table i.e the inner query.
whereas join gives the result from both the tables if condition is satisfied