This document outlines the naming conventions used for schemas, tables, views, columns, and other objects in the data warehouse.
- Naming Conventions: Use snake_case, with lowercase letters and underscores (
_) to separate words. - Language: Use English for all names.
- Avoid Reserved Words: Do not use SQL reserved words as object names.
- All names must start with the source system name, and table names must match their original names without renaming.
<sourcesystem>_<entity><sourcesystem>: Name of the source system (e.g.,crm,erp).<entity>: Exact table name from the source system.- Example:
crm_customer_info→ Customer information from the CRM system.
- All names must start with the source system name, and table names must match their original names without renaming.
<sourcesystem>_<entity><sourcesystem>: Name of the source system (e.g.,crm,erp).<entity>: Exact table name from the source system.- Example:
crm_customer_info→ Customer information from the CRM system.
- All names must use meaningful, business-aligned names for tables, starting with the category prefix.
<category>_<entity><category>: Describes the role of the table, such asdim(dimension) orfact(fact table).<entity>: Descriptive name of the table, aligned with the business domain (e.g.,customers,products,sales).- Examples:
dim_customers→ Dimension table for customer data.fact_sales→ Fact table containing sales transactions.
| Pattern | Meaning | Example(s) |
|---|---|---|
dim_ |
Dimension table | dim_customer, dim_product |
fact_ |
Fact table | fact_sales |
report_ |
Report table | report_customers, report_sales_monthly |
- All primary keys in dimension tables must use the suffix
_key. <table_name>_key<table_name>: Refers to the name of the table or entity the key belongs to._key: A suffix indicating that this column is a surrogate key.- Example:
customer_key→ Surrogate key in thedim_customerstable.
- All technical columns must start with the prefix
dwh_, followed by a descriptive name indicating the column's purpose. dwh_<column_name>dwh: Prefix exclusively for system-generated metadata.<column_name>: Descriptive name indicating the column's purpose.- Example:
dwh_load_date→ System-generated column used to store the date when the record was loaded.
-
All stored procedures used for loading data must follow the naming pattern:
-
load_<layer>.<layer>: Represents the layer being loaded, such asbronze,silver, orgold.- Example:
load_bronze→ Stored procedure for loading data into the Bronze layer.load_silver→ Stored procedure for loading data into the Silver layer.