SH.SALES (table)

From dbscript Online Help
Jump to: navigation, search

wikibot

Table SH.SALES
Description facts table, without a primary key; all rows are uniquely identified by the combination of all foreign keys

Columns

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

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

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

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