Q&A-1Create organization-wide data naming standards.
Answer
What I'd say first
Three questions before writing anything: which warehouses and BI tools have to agree on the names, is there already a catalog holding glossary terms, and who is allowed to break a downstream consumer? Assuming Snowflake or BigQuery, dbt for transformation, and a BI layer that generates its own SQL, I'd ship three things: a short enforced core, a glossary that carries meaning, and a migration path. The core is about fifteen rules. Anything you can't lint gets ignored within a quarter.
The core
| element | rule | example |
|---|---|---|
| tables | plural snake_case, layer prefix | stg_stripe__charges, fct_orders, dim_customers |
| columns | singular snake_case | order_id |
| keys | _id business key, _sk surrogate | customer_id, customer_sk |
| timestamps | _at for timestamptz in UTC, _date for date | created_at, order_date |
| booleans | is_ / has_ prefix | is_active, has_refund |
| money | decimal plus currency suffix | amount_usd |
| aggregates | suffix the aggregation | revenue_total_usd, sessions_count |
Why lint, not a wiki page
A CI rule fails a pull request in seconds; a document fails nothing. SQLFluff covers the mechanical half: L010 keyword capitalisation, L014 unquoted identifier capitalisation, L029 reserved words used as identifiers, and you add a custom rule for the suffix conventions above. The dbt_project_evaluator package ships naming-convention checks for models, sources and tests, so the dbt side is mostly configuration.
The glossary is a separate artefact because syntax cannot carry semantics. revenue_total_usd tells you the unit and the aggregation; it does not tell you whether refunds are netted or which fiscal calendar applies. That goes in a dbt meta block or a catalog term, and the lint rule asserts every column in a mart has one.
Migration
Never rename in place. Rename the table, then put a view back under the old name:
ALTER TABLE fct_orders RENAME TO fct_orders_v2;
ALTER TABLE fct_orders_v2 RENAME COLUMN amount TO order_total_usd;
CREATE VIEW fct_orders AS
SELECT *, order_total_usd AS amount FROM fct_orders_v2;Readers keep working; writers break loudly, which is how you enumerate them. Drop the view after one deprecation cycle.
Failure modes I've seen
- Postgres truncates identifiers at 63 bytes. A column named
customer_subscription_renewal_effective_timestamp_utcsilently becomes something shorter, and two long names can collide at DDL time. Detect it in CI:SELECT column_name FROM information_schema.columns WHERE length(column_name) > 63. - Quoted-case traps. Snowflake folds unquoted identifiers to uppercase and treats quoted ones as case-sensitive; BigQuery is case-insensitive for columns but case-sensitive for tables. A model created as
"OrderId"breaks the BI tool that emitsorderidwithinvalid identifier. Grep the dbt manifest for quoted identifiers before merge. - Renames without aliases. Count
column not founderrors in the warehouse query history, Snowflake'sACCOUNT_USAGE.QUERY_HISTORY(up to two hours of latency) or BigQuery'sINFORMATION_SCHEMA.JOBS_BY_PROJECT, in the seven days after a release. That number, not a style score, is the metric.
Governance
Exceptions go in a naming_exceptions.yml with an owner and an expiry date, reviewed quarterly. Don't retrofit a 4,000-table legacy schema in one pass; apply the standard to new tables and rename on touch. And don't rename anything in a published API contract or a regulatory extract without a versioned alias: the cost there is external, not internal.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.