AI Reports

Guides › Database reference › Products and attributes

Magento 2 eav_attribute table

The definition of every attribute of products, categories, customers and addresses: its code, label, input type and which value table holds its data.

Key columns

ColumnWhat it means
attribute_idAttribute ID, used in all the value tables.
entity_type_idWhat it belongs to, linking to eav_entity_type (catalog_product, catalog_category, customer, customer_address).
attribute_codeThe code, such as name, status or color.
frontend_labelThe default label.
backend_typeWhich value table it uses: int, varchar, decimal, text, datetime, or static (a column on the main table).
frontend_inputThe input type: select, multiselect, text, boolean, price and so on.
is_user_defined1 = created in the admin or by an extension, not by Magento core.

Good to know

Example: Your own product attributes (created in the admin or by extensions)

Works on Magento Open Source and Adobe Commerce.

SELECT a.attribute_code, a.frontend_label, a.backend_type, a.frontend_input
FROM eav_attribute a
JOIN eav_entity_type t ON t.entity_type_id = a.entity_type_id AND t.entity_type_code = 'catalog_product'
WHERE a.is_user_defined = 1
ORDER BY a.attribute_code;

Tested on Magento Open Source and Adobe Commerce 2.4.8. Read-only. If your tables have a prefix, add it to each table name.

This table has the same 17 columns on Magento Open Source and Adobe Commerce.

Foreign keys

All 17 columns (Magento Open Source)

Show all columns
ColumnTypeCan be emptyMagento's description
attribute_idsmallint(5) unsignedAttribute ID
entity_type_idsmallint(5) unsignedEntity Type ID
attribute_codevarchar(255)Attribute Code
attribute_modelvarchar(255)yesAttribute Model
backend_modelvarchar(255)yesBackend Model
backend_typevarchar(8)Backend Type
backend_tablevarchar(255)yesBackend Table
frontend_modelvarchar(255)yesFrontend Model
frontend_inputvarchar(50)yesFrontend Input
frontend_labelvarchar(255)yesFrontend Label
frontend_classvarchar(255)yesFrontend Class
source_modelvarchar(255)yesSource Model
is_requiredsmallint(5) unsignedDefines Is Required
is_user_definedsmallint(5) unsignedDefines Is User Defined
default_valuetextyesDefault Value
is_uniquesmallint(5) unsignedDefines Is Unique
notevarchar(255)yesNote

Related tables

Gaurav Harsh

Gaurav Harsh is a Magento developer who works on large Adobe Commerce stores and builds AI Reports, a Magento extension for asking your store's data questions in plain English. LinkedIn