mdatool.

Loading usage...

Settings
Abbreviation
Retail & E-commerce

customer identifier

customer_id

Usage Notes

Unique identifier assigned to each customer across the e-commerce platform

Global Definition

Unique system identifier for the customer.

Sources

Customer

View Full Definition

Schema Preview

application/json
{
  "abbreviation": "customer_id",
  "fullTerm": "customer identifier",
  "domain": "retail-ecommerce",
  "metadata": {
    "hasDefinition": true,
    "type": "acronym"
  }
}

Related Fields

Part of Common Pattern

Usage Examples

Customers Table Design

Standard customer table with email uniqueness

table design
CREATE TABLE customers (
  customer_id BIGINT PRIMARY KEY,
  email VARCHAR(255) UNIQUE NOT NULL,
  first_name VARCHAR(100) NOT NULL,
  last_name VARCHAR(100) NOT NULL,
  phone_number VARCHAR(20),
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  is_active BOOLEAN DEFAULT true,
  last_login_at TIMESTAMP
);

CREATE INDEX idx_customers_email ON customers(email);
CREATE INDEX idx_customers_name ON customers(last_name, first_name);

Customer Order History

Calculate customer lifetime value and order metrics

query
SELECT 
  c.customer_id,
  c.email,
  c.first_name,
  c.last_name,
  COUNT(o.order_id) as total_orders,
  SUM(o.total_amount) as lifetime_value,
  MAX(o.order_date) as last_order_date
FROM customers c
LEFT JOIN orders o ON c.customer_id = o.customer_id
WHERE c.customer_id = ?
GROUP BY c.customer_id, c.email, c.first_name, c.last_name;

💡 Pro Tip: Copy these examples and adapt them to your specific use case. Always add appropriate indexes and constraints for production databases.