Guides › Database reference
Magento 2 database reference
The Magento tables you'll query most, explained in plain English: what each one stores, the columns that matter, the traps, and a tested example query. Every column list comes from a real Magento 2.4.8 database, with the Adobe Commerce differences marked.
Orders and sales
- sales_orderOne row per order: its number, state and status, customer, store view, totals and currencies. Every other sales table points back to it.
- sales_order_itemOne row per product line in an order. Configurable and bundle products have a parent row plus child rows, so the same sale can appear twice.
- sales_order_addressThe billing and shipping address of each order, copied at checkout, so later changes to a customer's address book don't change past orders.
- sales_order_paymentThe payment of each order: the method used, amounts authorised, paid and refunded, and the gateway's references.
- sales_order_gridA flattened copy of each order that powers Sales › Orders in the admin. It's built from sales_order and its addresses and payment.
- sales_invoiceOne row per invoice. An order can have several invoices if it was invoiced in parts.
Carts
- quoteShopping carts. Every cart, from guests and logged-in customers, is a row here, whether or not it became an order.
- quote_itemThe products in each cart. Like order items, configurable and bundle products have a parent row plus child rows.
Customers
- customer_entityOne row per registered customer account. Guest shoppers aren't here; their details live only on their orders.
- customer_address_entityCustomers' saved address book entries. A customer can have many; their defaults are chosen on customer_entity.
Products and attributes
- catalog_product_entityOne row per product (per version on Adobe Commerce). It has only a few fixed columns; names, prices and everything else are in attribute value tables.
- catalog_product_entity_intWhole-number product values: status, visibility, tax class, and every dropdown attribute (where the value is the option ID). One row per product, attribute and store view.
- catalog_product_entity_varcharShort text product values (up to 255 characters): name, URL key, image paths, meta title and other text attributes. One row per product, attribute and store view.
- catalog_product_entity_decimalDecimal product values: price, special_price, cost, weight and other decimal attributes.
- eav_attributeThe definition of every attribute of products, categories, customers and addresses: its code, label, input type and which value table holds its data.
Categories and stock
- catalog_category_productWhich products are in which categories, and their position in each.
- cataloginventory_stock_itemStock settings and quantity per product for the default stock. With Multi-Source Inventory (MSI), Magento keeps it in sync with the default source.
- inventory_source_itemMulti-Source Inventory: the quantity and stock status of each SKU in each source (warehouse or shop).