There are three basic types of joins: Cross joins, Inner joins, and outer joins. The cross join has only one step-cartesian product; There are two steps in the inner join-Cartesian product, filtering, outer join has three steps-cartesian product, filtering, adding outer row.
Inner joins
Code:
SELECT e.empid, E.firstname, E.lastname, O.orderid from as E JOIN as O on = O.empid;
Another way to do this:
SELECT e.empid, E.firstname, E.lastname, O.orderid from as as O WHERE = O.empid;
The above notation is similar to a cross join.
Outer Joins
In an outer join, to mark a table as a "reserved" table, you can use the keyword left OUTER join, the right OUTER join, and the full OUTER join between table names, where the OUTER keyword is optional. Left indicates that the row of the table to the right is reserved, and that the row of the table on the side is reserved, and full indicates that the rows of the table on both sides are preserved.
SELECT C.custid, C.companyname, O.orderid from as C Left OUTER JOIN as O on = O.custid;
Note-microsoft SQL Server 2008 Tech Insider: T-SQL Language Foundation-03 Join query