When to use a natural SQL join instead of join .. on?

I am studying SQL for a database exam and how I saw SQL is how it looks on this page:

http://en.wikipedia.org/wiki/Star_schema IE joinwrote the path Join <table name> On <table attribute>and then the join condition for selection. My study book and my exercises given to me from the school, however, use only the natural mix in their examples. So, when is the natural mix right? Should a natural join be used if the query can also be written using JOIN .. ON?

Thanks for any reply or comment.

+5
source share
3 answers

. , , .

+9

IMO, JOIN ON , . - , , .

+5

. , , .

JOIN SQL .

*  JOIN: Return rows when there is at least one match in both tables
* LEFT JOIN: Return all rows from the left table, even if there are no matches in the right table
* RIGHT JOIN: Return all rows from the right table, even if there are no matches in the left table
* FULL JOIN: Return rows when there is a match in one of the tables

http://www.w3schools.com/sql/sql_join_inner.asp

FULL CONNECTION http://www.w3schools.com/sql/sql_join_full.asp

+1
source

All Articles