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
| Column | What it means |
|---|---|
entity_id | Address ID. |
parent_id | The customer, linking to customer_entity.entity_id. |
firstname / lastname / company | The name on the address. |
street | Street lines, separated by a new line. |
city / region / region_id / postcode | Town, state or county, and postcode. |
country_id | Two-letter country code. |
telephone / vat_id | Phone number and VAT number. |
Good to know
- Changing an address here doesn't change past orders: they keep their own copy in
sales_order_address.
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
parent_id→ customer_entity.entity_id
All 25 columns (Magento Open Source)
Show all columns
| Column | Type | Can be empty | Magento's description |
|---|---|---|---|
entity_id | int(10) unsigned | Entity ID | |
increment_id | varchar(50) | yes | Increment ID |
parent_id | int(10) unsigned | yes | Parent ID |
created_at | timestamp | Created At | |
updated_at | timestamp | Updated At | |
is_active | smallint(5) unsigned | Is Active | |
city | varchar(255) | City | |
company | varchar(255) | yes | Company |
country_id | varchar(255) | Country | |
fax | varchar(255) | yes | Fax |
firstname | varchar(255) | First Name | |
lastname | varchar(255) | Last Name | |
middlename | varchar(255) | yes | Middle Name |
postcode | varchar(255) | yes | Zip/Postal Code |
prefix | varchar(40) | yes | Name Prefix |
region | varchar(255) | yes | State/Province |
region_id | int(10) unsigned | yes | State/Province |
street | text | Street Address | |
suffix | varchar(40) | yes | Name Suffix |
telephone | varchar(255) | Phone Number | |
vat_id | varchar(255) | yes | VAT number |
vat_is_valid | int(10) unsigned | yes | VAT number validity |
vat_request_date | varchar(255) | yes | VAT number validation request date |
vat_request_id | varchar(255) | yes | VAT number validation request ID |
vat_request_success | int(10) unsigned | yes | VAT number validation request success |