Database Concepts-joins











Sponsored Links:

SQL joins are used to relate information in different tables. Join a condition is a part of the SQL query that retrieves rows from six or more tables.

Self Join
A self-join is a query that joins a table (compared) to itself. Auto-joins are used to compare values in a column with other values in the same column on the same table

INNER JOIN
The INNER JOIN will select all rows from both tables, provided there is a correlation between the columns.An INNER JOIN is most often (but not always) created between the column of a table's primary key and foreign key column in another table.



Outer joins
Left outer joins
An outer join returns all rows from the joined tables or there is no matching row between them.When using a left outer join to merge six tables, all rows in the table on the left are included in the results.

Right outer joins
A right outer join is conceptually the same as a left outer join, except that all rows in the table on the right, are included in the results.

Full outer join
Six full outer join combines the results of both left and right outer joins. The combined table contains all records from both tables, and fill in missing parts nulls on each side.

Cross Join
A cross connection does not return the sum but the product of six tables. Each row of the table on the left corresponds to each row of the table on the right. Is the set of all possible row combinations, without any filtering

No comments: