--- title: Users table description: "Shopify Data Warehouse documentation: Users table." source_url: html: https://shopify.dev/docs/apps/build/data-warehouse/reference/schema/users md: https://shopify.dev/docs/apps/build/data-warehouse/reference/schema/users.md --- # Users table The users table contains information about the staff accounts in the store. It contains one row per staff account. Use this table to generate a list of your staff accounts, or join it with the [sales](https://shopify.dev/docs/apps/build/data-warehouse/reference/schema/sales), [API clients](https://shopify.dev/docs/apps/build/data-warehouse/reference/schema/api_clients) and [locations](https://shopify.dev/docs/apps/build/data-warehouse/reference/schema/locations) tables to analyze staff performance at Shopify Point of Sale (POS) locations. ### Columns | Column | Data type | Description | | - | - | - | | user\_id | numeric | The unique identifier for the user of your Shopify POS or your Shopify admin. This column is the **primary key** for the 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 staff member. | | last\_name | varchar | Last name of the staff member. | | email | varchar | Email address of the staff member. | ### Remarks Only Shopify POS orders and draft orders are associated with a staff member. Shopify POS orders are associated with the staff member who is logged into the POS at the time of the sale. Draft orders are associated with the staff member who converts the draft order to an order. Online store sales do not have a staff member associated with their sales. ### Examples The following SQL query returns Shopify POS data by staff member: ```SQL SELECT (users.first_name || ' ' || users.last_name) AS user_name, SUM(total_sales) AS total_sales, SUM(returns) AS returns, (CASE WHEN SUM(total_sales) > 0 THEN 1.0 * SUM(returns) / SUM(total_sales) END) AS returns_ratio FROM shopify.sales LEFT JOIN shopify.api_clients ON sales.api_client_id = api_clients.api_client_id LEFT JOIN shopify.users ON sales.user_id = users.user_id WHERE api_clients.title = 'Point of Sale' GROUP BY 1 ORDER BY 2 DESC; ``` ### Related information * [CASE Expression(Amazon Redshift Documentation)](http://docs.aws.amazon.com/redshift/latest/dg/r_CASE_function.html) * [FROM Clause, including information on joins (Amazon Redshift)](http://docs.aws.amazon.com/redshift/latest/dg/r_FROM_clause30.html) ***