Difference between revisions of "OE.ORDERS (table)"
| Line 5: | Line 5: | ||
| '''Table | | '''Table | ||
| OE.ORDERS | | OE.ORDERS | ||
| + | |- valign="top" | ||
| + | | '''Description | ||
| + | | Contains orders entered by a salesperson as well as over the Web. | ||
|- | |- | ||
|} | |} | ||
| + | === Columns === | ||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
| Line 15: | Line 19: | ||
| '''Nullable | | '''Nullable | ||
| '''Default | | '''Default | ||
| − | | ''' | + | | '''Description |
| − | |||
|- | |- | ||
| Line 23: | Line 26: | ||
| not null | | not null | ||
| | | | ||
| − | | | + | | PRIMARY KEY column. |
| − | |||
|- | |- | ||
| ORDER_DATE | | ORDER_DATE | ||
| Line 30: | Line 32: | ||
| not null | | not null | ||
| | | | ||
| − | | | + | | TIMESTAMP WITH LOCAL TIME ZONE column, NOT NULL constraint. |
| − | |||
|- | |- | ||
| ORDER_MODE | | ORDER_MODE | ||
| Line 37: | Line 38: | ||
| null | | null | ||
| | | | ||
| − | | | + | | CHECK constraint. |
| − | |||
|- | |- | ||
| CUSTOMER_ID | | CUSTOMER_ID | ||
| Line 45: | Line 45: | ||
| | | | ||
| | | | ||
| − | |||
|- | |- | ||
| ORDER_STATUS | | ORDER_STATUS | ||
| Line 51: | Line 50: | ||
| null | | null | ||
| | | | ||
| − | | | + | | 0: Not fully entered, 1: Entered, 2: Canceled - bad credit, - |
| − | + | 3: Canceled - by customer, 4: Shipped - whole order, - | |
| + | 5: Shipped - replacement items, 6: Shipped - backlog on items, - | ||
| + | 7: Shipped - special delivery, 8: Shipped - billed, 9: Shipped - payment plan,- | ||
| + | 10: Shipped - paid | ||
|- | |- | ||
| ORDER_TOTAL | | ORDER_TOTAL | ||
| Line 58: | Line 60: | ||
| null | | null | ||
| | | | ||
| − | | | + | | CHECK constraint. |
| − | |||
|- | |- | ||
| SALES_REP_ID | | SALES_REP_ID | ||
| Line 65: | Line 66: | ||
| null | | null | ||
| | | | ||
| − | | | + | | References hr.employees.employee_id. |
| − | |||
|- | |- | ||
| PROMOTION_ID | | PROMOTION_ID | ||
| Line 72: | Line 72: | ||
| null | | null | ||
| | | | ||
| + | | Sales promotion ID. Used in SH schema | ||
| + | |} | ||
| + | |||
| + | === Primary Key === | ||
| + | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
| + | |- style="background:silver" | ||
| + | | '''Primary Key | ||
| + | | '''Columns | ||
| + | |- | ||
| + | | ORDER_PK | ||
| + | | ORDER_ID | ||
| + | |} | ||
| + | |||
| + | === Indexes === | ||
| + | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
| + | |- style="background:silver" | ||
| + | | '''Index | ||
| + | | '''Type | ||
| + | | '''Columns | ||
| + | |||
| + | |- | ||
| + | | ORD_SALES_REP_IX | ||
| + | | | ||
| + | | SALES_REP_ID | ||
| + | |- | ||
| + | | ORD_CUSTOMER_IX | ||
| | | | ||
| + | | CUSTOMER_ID | ||
| + | |- | ||
| + | | ORD_ORDER_DATE_IX | ||
| | | | ||
| + | | ORDER_DATE | ||
|} | |} | ||
| + | === Check Constraints === | ||
| + | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
| + | |- style="background:silver" | ||
| + | | '''Check Constraint | ||
| + | | '''Expression | ||
| + | | '''Description | ||
| + | |||
| + | |- | ||
| + | | ORDER_CUSTOMER_ID_NN | ||
| + | | "CUSTOMER_ID" IS NOT NULL | ||
| + | | | ||
| + | |- | ||
| + | | ORDER_DATE_NN | ||
| + | | "ORDER_DATE" IS NOT NULL | ||
| + | | | ||
| + | |- | ||
| + | | ORDER_MODE_LOV | ||
| + | | order_mode in ('direct','online') | ||
| + | | | ||
| + | |- | ||
| + | | ORDER_TOTAL_MIN | ||
| + | | order_total >= 0 | ||
| + | | | ||
| + | |} | ||
| − | + | === Foreign Keys === | |
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
| Line 94: | Line 148: | ||
|} | |} | ||
| − | + | === Detail Tables === | |
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
|- style="background:silver" | |- style="background:silver" | ||
| Line 105: | Line 159: | ||
| ORDER_ID | | ORDER_ID | ||
| ORDER_ID | | ORDER_ID | ||
| + | |} | ||
| + | |||
| + | === Dependencies === | ||
| + | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
| + | |- style="background:silver" | ||
| + | | '''Reference Type | ||
| + | | '''Object Type | ||
| + | | '''Referencing Object | ||
| + | |||
| + | |- | ||
| + | | Select | ||
| + | | View | ||
| + | | [[OE.OC_CORPORATE_CUSTOMERS_(view)|OE.OC_CORPORATE_CUSTOMERS]] | ||
| + | |||
| + | |- | ||
| + | | Select | ||
| + | | View | ||
| + | | [[OE.OC_CUSTOMERS_(view)|OE.OC_CUSTOMERS]] | ||
| + | |||
| + | |- | ||
| + | | Select | ||
| + | | View | ||
| + | | [[OE.OC_ORDERS_(view)|OE.OC_ORDERS]] | ||
| + | |||
| + | |- | ||
| + | | Select | ||
| + | | View | ||
| + | | [[OE.ORDERS_VIEW_(view)|OE.ORDERS_VIEW]] | ||
| + | |||
| + | |- | ||
| + | | Insert | ||
| + | | Trigger | ||
| + | | [[OE.ORDERS_TRG|OE.ORDERS_TRG]] | ||
| + | |||
|} | |} | ||
Revision as of 08:28, 11 February 2010
Contents
wikibot
| Table | OE.ORDERS |
| Description | Contains orders entered by a salesperson as well as over the Web. |
Columns
| Column | Data Type | Nullable | Default | Description |
| ORDER_ID | NUMBER(12, 0) | not null | PRIMARY KEY column. | |
| ORDER_DATE | TIMESTAMP(6) WITH LOCAL TIME ZONE | not null | TIMESTAMP WITH LOCAL TIME ZONE column, NOT NULL constraint. | |
| ORDER_MODE | VARCHAR2(8) | null | CHECK constraint. | |
| CUSTOMER_ID | NUMBER(6, 0) | not null | ||
| ORDER_STATUS | NUMBER(2, 0) | null | 0: Not fully entered, 1: Entered, 2: Canceled - bad credit, -
3: Canceled - by customer, 4: Shipped - whole order, - 5: Shipped - replacement items, 6: Shipped - backlog on items, - 7: Shipped - special delivery, 8: Shipped - billed, 9: Shipped - payment plan,- 10: Shipped - paid | |
| ORDER_TOTAL | NUMBER(8, 2) | null | CHECK constraint. | |
| SALES_REP_ID | NUMBER(6, 0) | null | References hr.employees.employee_id. | |
| PROMOTION_ID | NUMBER(6, 0) | null | Sales promotion ID. Used in SH schema |
Primary Key
| Primary Key | Columns |
| ORDER_PK | ORDER_ID |
Indexes
| Index | Type | Columns |
| ORD_SALES_REP_IX | SALES_REP_ID | |
| ORD_CUSTOMER_IX | CUSTOMER_ID | |
| ORD_ORDER_DATE_IX | ORDER_DATE |
Check Constraints
| Check Constraint | Expression | Description |
| ORDER_CUSTOMER_ID_NN | "CUSTOMER_ID" IS NOT NULL | |
| ORDER_DATE_NN | "ORDER_DATE" IS NOT NULL | |
| ORDER_MODE_LOV | order_mode in ('direct','online') | |
| ORDER_TOTAL_MIN | order_total >= 0 |
Foreign Keys
| Relation | Column | Referenced Column |
| OE.CUSTOMERS | CUSTOMER_ID | CUSTOMER_ID |
| HR.EMPLOYEES | SALES_REP_ID | EMPLOYEE_ID |
Detail Tables
| Detail Table | Column | Referencing Column |
| OE.ORDER_ITEMS | ORDER_ID | ORDER_ID |
Dependencies
| Reference Type | Object Type | Referencing Object |
| Select | View | OE.OC_CORPORATE_CUSTOMERS |
| Select | View | OE.OC_CUSTOMERS |
| Select | View | OE.OC_ORDERS |
| Select | View | OE.ORDERS_VIEW |
| Insert | Trigger | OE.ORDERS_TRG |