I have a question for you MySQL Experts.
Say that I have the following tables, with the following columns:
Please note that the names of some of the columns are due to my obsessive need to always know what columns relate to other tables, but this has nothing to do with the question.
Manufacturers:
manufacturer_id
manufacturer_name
-- other manufacturer data columns
ProductTypes:
producttype_id
producttype_name
-- other product type data columns
Categories:
category_id
category_name
-- other category data columns
Images:
image_id
image_uri
-- other image data columns
Products:
product_id
Maufacturers_manufacturer_
id
ProductTypes_producttype_i
d
Categories_category_id
Images_image_id
product_name
-- other product data columns
Lets say that I create the following query:
Select * From Products, Manufactures, ProductTypes, Categories, Images
Where Products.Manufacturers_man
ufacturer_
id = Manufacturers.manufacturer
_id
AND Products.ProductTypes_prod
uct_type_i
d = ProductTypes.producttype_i
d
AND Products.Categories_catego
ry_id = Categories.category_id
AND Products.Images_image_id = Images.image_id
;
I know the above works and returns exactly what I expect it to return. To me this also seems quite straight forward and easy to understand, I can see exactly how things are related.
On the other hand, I'm not too clear on all the Join types and what they actually do.
Here is my question. Is there some advantage to using Joins rather than using syntax as in my example? Do joins make the query faster? or Slower? Is there some other advantage that I'm missing out on?
It seems to me that there is actually less coding in the above than to use Joins as you still need to indicate what columns are related to what columns, plus add the correct Join syntax.
Please enlighten me...
Start Free Trial