For OneDayWhen:
Assuming the Product and Order_Detail tables:
create table PRODUCT
(
PRODUCT_ID NUMBER(38,0) not null,
PRODUCT_NAME VARCHAR2(100) not null,
PRODUCT_DESCR VARCHAR2(4000) null,
ACTIVE_FLAG NUMBER(1,0) DEFAULT 1 not null
);
create table ORDER_DETAIL
(
ORDER_DETAIL_ID NUMBER(38,0) not null,
ORDER_ID NUMBER(38,0) not null,
PRODUCT_ID NUMBER(38,0) not null,
LIST_PRICE NUMBER(18,3) not null,
DISC_PRICE NUMBER(18,3) not null,
QUANTITY NUMBER(10,0) not null
);
When one deactivates a product, there may still be outstanding orders which include that product. Archiving the orders doesn't solve the problem. Similarly, what if you want to add a product, but can't accept orders until some date when it's actively released? (Think Apple products.)
Having the application use a view (ACTIVE_PRODUCTS_VW) to show only active products for ordering makes this much easier.
create view ACTIVE_PRODUCTS_VW
as
select * from PRODUCT where ACTIVE_FLG = 1;
In Oracle, you can leverage a feature of indexing (where entirely NULL index keys are not indexed) to ensure that the indexes against the active products are small.
CREATE INDEX ACTIVE_PRODUCTS_IDX01 on PRODUCT
( CASE ACTIVE_FLG WHEN 0 THEN NULL ELSE PRODUCT_ID END );