Tuesday, 11 October 2011

Joins

{\rtf1\ansi\ansicpg1252\deff0\deflang16393{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\fnil\fcharset0 Calibri;}}
{\colortbl ;\red0\green0\blue0;}
{\stylesheet{ Normal;}{\s1 heading 1;}}
{\*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\li1080\lang1033\f0\fs22 Join is the process of combining data from two or more tables using matching columns. This relational computing feature consolidates multiple data tables for use in a single report.\par
The SQL JOIN statement is used to combine the data contained in two relational database tables based upon a common attribute. \par
\pard\fi720\li360\b Different Joins\par
\pard\keepn\s1\li1080 Equi-Join\par
\pard\li1080\b0 A join statement that uses an equivalency operation (i.e: colA = colB). The converse of an equijoin is a nonequijoin operation. In the Equi-Join two (or more) tables are linked via a common domain attribute. This is the most common form of joining used in relational data manipulation. \par
\pard\keepn\s1\li1080\b Outer Join\par
\pard\li1080\b0 The Outer-Join is the opposite of an Equi-Join. It searches for records that exist outside of the specified Join condition. The (+) symbol is the Outer Join operator, which causes the join condition to be inverted.\par
\pard\keepn\s1\li1080\b Self Join\par
\pard\li1080\b0 A join in which a table is joined with itself.\fs18 \fs22 Sometimes we need to join a table to itself in order to search for the correct data. \par
\b Nonequijoin\b0 \par
A join statement that does not use an equality operation (i.e: colA <> colB). The converse of a nonequijoin is a equijoin. \par
\par
\cf1 There are three types of outer joins: left outer, right outer, and full outer. All outer joins retrieve records from both tables, just as an inner join does. However, an outer join retrieves all of the records from one of the tables. A column in the result is NULL if the corresponding input table did not contain a matching record.\par
\pard\par
\pard\li1080\cf0 The left outer join retrieves records from both tables, retrieving all the records from the left table and any records from the right table where the condition values match. If there are no matching values in from the right table, the join still retrieves all the records from the left table. Any columns from the right table that are unmatched are left NULL. Consequently, the resulting record set often appears to have incomplete records. \par
The right outer join is similar to the left outer join in that it retrieves all the records from one side of the relationship, but this time it's the right table. Only records where the condition values match are retrieved from the left.\par
\cf1 The full outer join retrieves all records from both the left and the right table.\par
\cf0 Full outer joins effectively combine the left and right outer joins so that data will be returned if it matches in both tables, or if it exist in either one.\par
Cross-Joins create a Cartesian product, rather like when you forget to include a "where" clause to join two tables. There are not many cases where you would want to use a cross join.\par
\pard\sa200\sl276\slmult1\lang9\f1\par
}

No comments:

Post a Comment