Это - обычная практика в схеме "звезда" к названиям таблицы префиксов как таблица измерений или таблица фактов? Это - также обычная практика, чтобы снабдить префиксом имена столбцов имя таблицы?
В моих нормальных базах данных OLTP я не делаю этого, но я вижу примеры этого типа именования в схемах "звезда".
Имеет смысл иметь другой набор именования стандартов для схем хранилища данных по сравнению со схемами OLTP?
Спасибо Dwight
The tablename_column name convention is used to ensure that all fields within a database are unique, although it is somewhat excessive it can be used for when there is a standard / requirement for unique naming (Which some client IT departments demand.)
Product.Name => Product.Product_Name
Part.Name => Part.Part_Name
It removes any ambiguity over where Name would come from.
I prefer not to name tables with a prefex at all (assuming that does not break the local standards of a company), since whilst it might be a table today, it could be re-implemented as a view or partitioned view tomorrow but expose the same schema, and I would then have to accept objects prefixed incorrectly or update everyones reference to the new name / create a synonym.
Having consistency though tends to be the winner, if every DBA / Dev implemented their own version it would be chaos, so I would tend to find the company standards and apply them.
В хранилищах данных принято называть столбцы «длинными именами», потому что эти столбцы становятся заголовками столбцов в отчетах (результатах запроса) и должны быть удобными для бизнес-пользователей. Поэтому вместо Product.Name
и Customer.Name
, которые будут отображаться как «Имя» (если не используется псевдоним), обычно используется Product.ProductName
и Customer.CustomerName
, поэтому они отображаются как "ProductName" и "
Имена таблиц :
Имена столбцов:
Хранилище и присвоение имен OLTP: