Overview Tables Views Indexes Constraints Triggers Procedures Functions Packages Sequences Index

OE


Description  Columns  Primary key  Check constraints  Foreign keys  Unique keys  Indexes  Options  Referenced by  Triggers  

ORDERS

Description

Contains orders entered by a salesperson as well as over the Web.

Columns

Column Datatype Nullable Default value Comment
ORDER_ID NUMBER(12,0) N   PRIMARY KEY column.
ORDER_DATE TIMESTAMP(6) WITH LOCAL TIME ZONE(11) N   TIMESTAMP WITH LOCAL TIME ZONE column, NOT NULL constraint.
ORDER_MODE VARCHAR2(8) Y   CHECK constraint.
CUSTOMER_ID NUMBER(6,0) N    
ORDER_STATUS NUMBER(2,0) Y   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) Y   CHECK constraint.
SALES_REP_ID NUMBER(6,0) Y   References hr.employees.employee_id.
PROMOTION_ID NUMBER(6,0) Y   Sales promotion ID. Used in SH schema

Primary key

Primary key Columns
ORDER_PK ORDER_ID

Check constraints

Check constraint Check condition
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

Foreign key Referenced table Referenced constraint Delete rule Columns
ORDERS_CUSTOMER_ID_FK CUSTOMERS CUSTOMERS_PK SET NULL CUSTOMER_ID

Indexes

Index Type Uniqueness Columns
ORD_CUSTOMER_IX NORMAL NONUNIQUE CUSTOMER_ID
ORDER_PK NORMAL UNIQUE ORDER_ID
ORD_ORDER_DATE_IX NORMAL NONUNIQUE ORDER_DATE
ORD_SALES_REP_IX NORMAL NONUNIQUE SALES_REP_ID

Options

Option Setting
Clustered N
Generated by Oracle N
Index Organized N
Logging Y
Partitioned N
Temporary N
Nested N

Referenced by

Referenced by Constraint
ORDER_ITEMS ORDER_ITEMS_ORDER_ID_FK


Generated by
OraDoclet, Copyright © Oracle Corporation 2005      Last updated: 01.01.2005