You can do all this in one query, several columns will remain empty:
SELECT t.product_type_name, t.product_type_id p.product_id, p.product_name, p.[common attributes to all products...], m.*, w.* FROM product p INNER JOIN product_type t ON t.product_type_id = p.product_type_id LEFT JOIN magazine m ON m.product_id = p.product_id LEFT JOIN web_site w ON w.product_id = p.product_id WHERE p.product_id = ?
Use product_type_id in your application to determine which result set columns you are interested in in any given case.
In terms of performance, this should be pretty fast (foreign keys, indexes); and it creates a consistent set of results for any type of product.
I would recommend not using .* And explicitly listing each column name, it is more portable, more maintainable and less error prone.
source share