Useful queries for finding data using the Make/Model Parts databases MySQL server
Author
Thread
AuthorRich Allen 14th March 2018
I was using the Make/Model Parts Database's MySQL back end server and thought the below query might be useful for people who are trying to hunt down model mappings. If you are using the query you will need to sub data into the where clause.
SELECT model_product_category.Model_id, MakeName, model.ModelName, ModelYear, model_product_category.Product_id, Item_id, CategoryName FROM makemodelpartsdb.model_product_category INNER JOIN model ON (model.model_id = model_product_category.model_id) INNER JOIN make ON (model.make_id = make.make_id) INNER JOIN product ON (model_product_category.product_id = product.product_id) INNER JOIN category ON (category.category_id = model_product_category.category_id) WHERE ModelName = '' and ModelYear = '' AND Item_id = '' ORDER BY CategoryName;
14th March 2018
SELECT model_product_category.Model_id, MakeName, model.ModelName, ModelYear, model_product_category.Product_id, Item_id, CategoryName
FROM makemodelpartsdb.model_product_category
INNER JOIN model ON (model.model_id = model_product_category.model_id)
INNER JOIN make ON (model.make_id = make.make_id)
INNER JOIN product ON (model_product_category.product_id = product.product_id)
INNER JOIN category ON (category.category_id = model_product_category.category_id)
WHERE ModelName = '' and ModelYear = '' AND Item_id = ''
ORDER BY CategoryName;