CREATE TABLE PRODUCT (
    ID NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
    NAME VARCHAR2(255) NOT NULL,
    CATEGORY VARCHAR2(255) NOT NULL,
    PRICE NUMBER(10, 2) NOT NULL,
    IS_ACTIVE CHAR(1) DEFAULT 'Y' CHECK (IS_ACTIVE IN ('Y', 'N')),
    DETAILS CLOB CONSTRAINT DETAILS_IS_JSON CHECK (DETAILS IS JSON),
    INFO CLOB CONSTRAINT INFO_IS_JSON CHECK (INFO IS JSON)
);

-- 
BEGIN
    FOR i IN 1..100 LOOP
        INSERT INTO PRODUCT (NAME, CATEGORY, PRICE, IS_ACTIVE, DETAILS, INFO) 
        VALUES (
            'Product ' || i, 
            CASE 
                WHEN MOD(i, 3) = 0 THEN 'Electronics' 
                WHEN MOD(i, 3) = 1 THEN 'Books' 
                ELSE 'Clothing' 
            END, 
            ROUND(DBMS_RANDOM.VALUE(10, 1000), 2), 
            CASE 
                WHEN MOD(i, 2) = 0 THEN 'Y' 
                ELSE 'N' 
            END, 
            '{"description": "This is the details for product ' || i || '"}', 
            '{"additionalInfo": "This is some additional info for product ' || i || '"}'
        );
    END LOOP;
    COMMIT;
END;


select * from PRODUCT;


