--- title: Addresses table description: "Shopify Data Warehouse documentation: Addresses table." source_url: html: https://shopify.dev/docs/apps/build/data-warehouse/reference/schema/addresses md: https://shopify.dev/docs/apps/build/data-warehouse/reference/schema/addresses.md --- # Addresses table The addresses table contains the billing and shipping addresses of customers. You can join this table with the [sales](https://shopify.dev/docs/apps/build/data-warehouse/reference/schema/sales) table to generate lists of the billing and shipping addresses. Customers can enter their addresses more than once, so the same address can appear in more than one row in this table. This table contains one row per customer address. ### Columns | Column | Data type | Description | | - | - | - | | address\_id | numeric | The unique identifier for the address. This column is the **primary key** for the addresses table. | | [shop\_id](https://shopify.dev/docs/apps/build/data-warehouse/reference/schema/shops#shop_id) | numeric | The ID of the store. This column is a **foreign key** reference to the shop\_id column in the [shops](https://shopify.dev/docs/apps/build/data-warehouse/reference/schema/shops#shop_id) table. | | first\_name | varchar | First name of the customer. | | last\_name | varchar | Last name of the customer. | | address1 | varchar | The first address line. For example, 150 Elgin St. | | address2 | varchar | The second address line. For example, Suite 800. | | company | varchar | The name of the customer's business, if one exists. | | city | varchar | The name of the city. For example, Ottawa. | | region | varchar | The name of the region, such as a province or state, where the customer is located. For example, Ontario or New York. This column is the same as [CustomerAddress.province](https://shopify.dev/docs/api/admin-rest/latest/resources/customer-address) in the Admin API. | | zip | varchar | The ZIP or postal code. For example, 90210. | | country | varchar | The full name of the country. For example, Canada. | | phone | varchar | The phone number of the customer. | ### Examples The following SQL query returns total sales by shipping and billing countries: ```SQL SELECT shipping_address.country, billing_address.country, SUM(total_sales) FROM shopify.sales JOIN shopify.addresses AS shipping_address ON sales.shipping_address_id = shipping_address.address_id JOIN shopify.addresses AS billing_address ON sales.billing_address_id = billing_address.address_id GROUP BY 1, 2 ORDER BY 1; ``` ### Related links * [SUM Function (Amazon Redshift Documentation)](http://docs.aws.amazon.com/redshift/latest/dg/r_SUM.html) * [GROUP BY Clause (Amazon Redshift)](http://docs.aws.amazon.com/redshift/latest/dg/r_GROUP_BY_clause.html) * [FROM Clause, including JOIN types (Amazon Redshift Documentation)](http://docs.aws.amazon.com/redshift/latest/dg/r_FROM_clause30.html) * [JOIN Examples (Amazon Redshift Documentation)](http://docs.aws.amazon.com/redshift/latest/dg/r_Join_examples.html) * [ORDER BY Clause (Amazon Redshift Documentation)](http://docs.aws.amazon.com/redshift/latest/dg/r_ORDER_BY_clause.html) ***