I want to create a table that column value would be >0 and it can be null.
when I am doing this on the creation of table column
CREATE TABLE Ship
(
SITE_ID INTEGER NOT NULL,
Ship_CATEGORY VARCHAR2(50) CHECK (WRECK_CATEGORY IN ('Military','Government','Passenger', 'Unknown', 'Commercial')),
Ship_TYPE VARCHAR2(100) ,
Ship_TONNAGE INTEGER CHECK ((WRECK_TONNAGE>0) AND WRECK_TONNAGE IS NULL) ,
Ship_CAUSE VARCHAR2(100) NULL CHECK (WRECK_CAUSE IN ('Fire', 'Collision','Unknown',' Deliberate', 'Explosion',' Attack', 'Other')),
Ship_DATESUNK DATE NULL,
Ship_CONDITION VARCHAR2(50) NULL CHECK (WRECK_CONDITION IN ('Excellent', 'Moderate','Poor', 'Very Poor')),
CONSTRAINT SHIPWRECK_PK PRIMARY KEY (SITE_ID)
);
in the line "Ship_TONNAGE INTEGER CHECK ((WRECK_TONNAGE>0) AND WRECK_TONNAGE IS NULL) ," when i am inserting null value to this column, it violates the constraint. how i create my table as it satisfy the condition? Thanks