Difference between revisions of "SH.SALES (table)"
Line 70: | Line 70: | ||
| '''Columns | | '''Columns | ||
− | |||
− | |||
− | |||
− | |||
|- valign="top" | |- valign="top" | ||
| SALES_CHANNEL_BIX | | SALES_CHANNEL_BIX | ||
Line 79: | Line 75: | ||
| CHANNEL_ID | | CHANNEL_ID | ||
|- valign="top" | |- valign="top" | ||
− | | | + | | SALES_CUST_BIX |
| | | | ||
− | | | + | | CUST_ID |
|- valign="top" | |- valign="top" | ||
| SALES_PROD_BIX | | SALES_PROD_BIX | ||
Line 90: | Line 86: | ||
| | | | ||
| PROMO_ID | | PROMO_ID | ||
+ | |- valign="top" | ||
+ | | SALES_TIME_BIX | ||
+ | | | ||
+ | | TIME_ID | ||
|} | |} | ||
Latest revision as of 10:36, 27 August 2011
wikibot[edit]
Table | SH.SALES |
Description | facts table, without a primary key; all rows are uniquely identified by the combination of all foreign keys |
Columns[edit]
Column | Data Type | Nullable | Default | Description |
PROD_ID | NUMBER | not null | FK to the products dimension table | |
CUST_ID | NUMBER | not null | FK to the customers dimension table | |
TIME_ID | DATE(7) | not null | FK to the times dimension table | |
CHANNEL_ID | NUMBER | not null | FK to the channels dimension table | |
PROMO_ID | NUMBER | not null | promotion identifier, without FK constraint (intentionally) to show outer join optimization | |
QUANTITY_SOLD | NUMBER(10, 2) | not null | product quantity sold with the transaction | |
AMOUNT_SOLD | NUMBER(10, 2) | not null | invoiced amount to the customer |
Indexes[edit]
Index | Type | Columns |
SALES_CHANNEL_BIX | CHANNEL_ID | |
SALES_CUST_BIX | CUST_ID | |
SALES_PROD_BIX | PROD_ID | |
SALES_PROMO_BIX | PROMO_ID | |
SALES_TIME_BIX | TIME_ID |
Check Constraints[edit]
Check Constraint | Expression | Description |
SYS_C005075 | "PROD_ID" IS NOT NULL | |
SYS_C005076 | "CUST_ID" IS NOT NULL | |
SYS_C005077 | "TIME_ID" IS NOT NULL | |
SYS_C005078 | "CHANNEL_ID" IS NOT NULL | |
SYS_C005079 | "PROMO_ID" IS NOT NULL | |
SYS_C005080 | "QUANTITY_SOLD" IS NOT NULL | |
SYS_C005081 | "AMOUNT_SOLD" IS NOT NULL |
Foreign Keys[edit]
Relation | Column | Referenced Column |
SH.CHANNELS | CHANNEL_ID | CHANNEL_ID |
SH.CUSTOMERS | CUST_ID | CUST_ID |
SH.PRODUCTS | PROD_ID | PROD_ID |
SH.PROMOTIONS | PROMO_ID | PROMO_ID |
SH.TIMES | TIME_ID | TIME_ID |