Join vs. sub-query I am an old-school MySQL user and have always preferred JOIN over sub-query. But nowadays everyone uses sub-query and I hate it, I don't know why. I lack the theoretical knowledge to judge for myself if there is any difference. Is a sub-query as good as a JOIN and therefore there is nothing to worry about? Answer: Taken from the manual (14.2.10.11 Rewriting Subqueries as Joins): A LEFT [OUTER] JOIN can be faster than an equivalent subquery because the server
undefined
INNER JOIN ON vs WHERE clause For simplicity, assume all relevant fields are NOT NULL. You can do: SELECT table1.this, table2.that, table2.somethingelse FROM table1, table2 WHERE table1.foreignkey = table2.primarykey AND (some other conditions) Or else: SELECT table1.this, table2.that, table2.somethingelse FROM table1 INNER JOIN table2 ON table1.foreignkey = table2.primarykey WHERE (some other conditions) Do these two work on the same way in MySQL? Answer : INNER JOIN is ANSI syntax which you should use. It is generally considered more readable, especially when you join lots of tables.

What's the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN? What's the difference between INNER JOIN, LEFT JOIN, RIGHT JOIN and FULL JOIN in MySQL? Answer: Reading this original article on The Code Project will help you a lot: Visual Representation of SQL Joins. Also check this post: SQL SERVER – Better Performance – LEFT JOIN or NOT IN?. Find original one at: Difference between JOIN and OUTER JOIN in MySQL. http://stackoverflow.com/questions/5706437/whats-the-difference-between-inner-join-left-join-right-join-and-full-join