AI Reports

Guides › Database reference › Customers

Magento 2 customer_address_entity table

Customers' saved address book entries. A customer can have many; their defaults are chosen on customer_entity.

Key columns

ColumnWhat it means
entity_idAddress ID.
parent_idThe customer, linking to customer_entity.entity_id.
firstname / lastname / companyThe name on the address.
streetStreet lines, separated by a new line.
city / region / region_id / postcodeTown, state or county, and postcode.
country_idTwo-letter country code.
telephone / vat_idPhone number and VAT number.

Good to know

Example: Customers per country (default billing address)

Works on Magento Open Source and Adobe Commerce.

SELECT a.country_id, COUNT(*) AS customers
FROM customer_entity c
JOIN customer_address_entity a ON a.entity_id = c.default_billing
GROUP BY a.country_id
ORDER BY customers DESC;

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 25 columns on Magento Open Source and Adobe Commerce.

Foreign keys

All 25 columns (Magento Open Source)

Show all columns
ColumnTypeCan be emptyMagento's description
entity_idint(10) unsignedEntity ID
increment_idvarchar(50)yesIncrement ID
parent_idint(10) unsignedyesParent ID
created_attimestampCreated At
updated_attimestampUpdated At
is_activesmallint(5) unsignedIs Active
cityvarchar(255)City
companyvarchar(255)yesCompany
country_idvarchar(255)Country
faxvarchar(255)yesFax
firstnamevarchar(255)First Name
lastnamevarchar(255)Last Name
middlenamevarchar(255)yesMiddle Name
postcodevarchar(255)yesZip/Postal Code
prefixvarchar(40)yesName Prefix
regionvarchar(255)yesState/Province
region_idint(10) unsignedyesState/Province
streettextStreet Address
suffixvarchar(40)yesName Suffix
telephonevarchar(255)Phone Number
vat_idvarchar(255)yesVAT number
vat_is_validint(10) unsignedyesVAT number validity
vat_request_datevarchar(255)yesVAT number validation request date
vat_request_idvarchar(255)yesVAT number validation request ID
vat_request_successint(10) unsignedyesVAT number validation request success

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