CREATE TABLE SALES_HISTORY_COMP ( PART_ID VARCHAR2(50) NOT NULL, STORE_ID VARCHAR2(50) NOT NULL, SALE_DATE DATE NOT NULL, QUANTITY NUMBER(10,2) NOT NULL ) COMPRESS ;
CREATE MATERIALIZED VIEW MV_SALES_COMP COMPRESS AS SELECT P.PART_NAME, H.STORE_ID, H.SALE_DATE, H.QUANTITY FROM SALES_HISTORY H, PARTS P WHERE P.PART_ID = H.PART_ID;