Your content here
Demographic segments must be stored as interpretable rules, not dashboard-only filters.
create table analytics.demographic_segment (
demographic_segment_id uuid primary key,
segment_key text not null unique,
segment_name text not null,
description text not null,
segment_type text not null check (
segment_type in (
'household',
'consumer_unit',
'person',
'business',
'occupation',
'custom'
)
),
created_at timestamptz not null default now()
);
create table analytics.demographic_segment_rule (
demographic_segment_rule_id uuid primary key,
demographic_segment_id uuid not null
references analytics.demographic_segment,
source_system text not null,
variable_name text not null,
operator text not null,
comparison_value jsonb not null,
logical_group integer not null,
rule_order integer not null
);
Households with children:
household_type in ('family_with_children')
Middle-income households:
household_income >= 75000
and household_income < 150000
Young professionals:
age_of_householder between 25 and 44
and household_income >= 60000
Potential family-play customers:
household_type in ('family_with_children')
and household_income >= 50000
and population_density >= defined_threshold