The prefix should be a short abbreviation that describes the type and role of the model.
These roles correspond to the different stages of the ELT process and will usually have a corresponding schema in the database.Refer to the Warehouse Layers section for more information on the different schema types.Following is a list of common warehouse layers and their corresponding prefixes:
raw_: Raw data from source systems.
stg_: Staging area for data transformation.
int_: Intermediate models that are created during the transformation process.
snap_: Snapshot models that store historical data.
Prefix: stg_part_Partial staging tables may be used in the cases where the source data exists in multiple tables or files or is otherwise split into multiple parts.
Examplesstg_part_accounts_deleted and stg_part_accounts_active which are then combined into stg_accounts.
Prefix: int_Intermediate tables that are created during the transformation process.
The name of a table should describe the data that is being transformed along with the nature of the transformation.
ExamplesA denormalised table that combines Salesforce accounts with their parent accounts may be called int_salesforce_accounts_with_parent.
For aggregated fact tables, the name should include all the dimensions that are being factored, as well as the frequency of the data.This will help to differentiate between different fact tables that may exist for the same entity - for example, monthly revenue vs daily revenue.
Examples
A fact table that contains all messages sent between users could be called fct_user_messages.
A fact table that contains monthly revenue data should be called fct_accounts_revenue_monthly.
Prefix: dim_Dimension tables should be named after the entity that the dimension is about. By default, it is assumed that the dimension table only contains the most recent data.
Prefix: mart_Mart tables or “exposures” are tables that are used for reporting and analysis. They are usually a combination of facts and dimensions.
They areused to expose data to end-users, are denormalised for ease of use and usually serve a specific business function or use case.These tables should be named after the business function or use case that they serve.
Examples
A mart table that contains customer retention cohort data could be called mart_customer_retention_cohorts.
A mart table used to create customer segments for online ads could be called mart_online_ads_customer_segments.