I was trying to find some fields because i want to obtain all the products and then, make a query but i was not able to do that(they dont appear in the database diagram for Magento 1.9):

This is the diagram:

diagram https://anna.voelkl.at/uploads/magento/ce1922.png

I only found the fields "SKU" and "min_sale_qty". What happened to the others?

Do these fields : code_brand, code_business_unit, code_line, code_group, code_business even exist or they were created by someone?


Anyway, i am using MYSQL connected to the MAGENTO database.

1 Answer 1


products in Magento are EAV models, which leads to most attributes not having an own column in the catalog_product_entity table.

If you are searching for a specific attribute value of a specific product you first have to go into the eav_attribute table, search the attribute you are looking for (by attribute_code for example) and get the id and type of the attribute.

For example values of the type text are saved in the catalog_product_entity_text table. To get the value you can filter it by product id (entity_id) and attribute_id. (There can still be multiple values for each store. store_id=0 is the default value).

The easiest way to get the values would be using the product repository (as it handles all needed db joins in the background for you).

If you must use sql to get the data you have to join the tables corresponding to your needs

  • Thank you for replying!. Can i access this table eav_attribute directly using a query? (select * from + table name). If so, after executing that query i have to look for this fields: (sku, code_brand, code_business_unit, code_line, code_group, code_business, min_sale_qty), get their id and type of the attribute. Am i right? How can i find those that are not type text?. Anyway, how can get the product repository? Commented Jan 27, 2019 at 13:34
  • Dude, if you have a little time off, can check my question: magento.stackexchange.com/questions/260205/… You are the one who knows! Commented Feb 2, 2019 at 14:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.