DAILY_REVENUE_PER_CUSTOMER
let's you know what a row most likely represents while REVENUE
is contains no information about the dimension._ACTIVE_1YR
or _ACTIVE_52WEEKS
is useful. Of course, it's not always feasible to put every filter and every dimension into the table name. At some point, it simply gets too long to be useful.CUSTOMER_PRODUCT_REVENUE_W52
. If the table contains several different metrics, try to identify what they have in common. Maybe it is all sales statistics like total sales, average weekly sales, standard deviation of sales, number of transactions and so on. In this case CUSTOMER_PRODUCT_SALES_STATISTICS_W52
might be a reasonable name.CUSTOMERMANAGEMENT_CUST_W52_N_PURCHASE_GT_1
is a reasonable name for the subset of customers who made at least one purchase in the last year, but CUSTOMERS_WHO_SHOPPED_LAST_YEAR
is a lot easier to understand. If you are like me and you still want the name of the 'module' or process that creates this table in the name, CUSTOMERMANAGEMENT_SHOPPED_LAST_YEAR
would be a good compromise.TEMP_
or STAG_
for 'temporary' or 'staging'. Secondly, you should make sure that the name of the table shows the process it belongs to. If there are five intermediate result tables during the calculation of your customer datamart, add some token to their name to make clear where they belong to. In this particular case, use the prefix TEMP_CUSTOMERDATAMART_
. This may seem intimidating because the resulting table names can get very long, especially when you take into account all the other advice from above. But if some person who is unfamiliar with your project ever has to look into your code or database, he will be glad that you chose such descriptive table names.CUSTOMER_SALES_STATISTICS
while a more 'technical' table like a temporary table used for calculating the customer sales statistics should follow the naming conventions more closely, e.g. TEMP_CUSTOMERSALESSTATS_RELEVANT_CUSTOMERS
. The same goes for abbreviations. If you stick to the rule of no abbreviations, you'll end up will long names that are kind of unwieldy. If all your temporary tables start with TEMP_CUSTOMERSALESSTATS_
, it probably makes sense to abbreviate it to something slightly shorter like TEMP_CUSTSTATS_
- even if that violates the rule.