Question: /* create the CLASS table */ CREATE TABLE CLASS( CLASS_CODE DECIMAL(5,0) NOT NULL, CRS_CODE VARCHAR(8) NOT NULL, CLASS_SECTION INTEGER NOT NULL CHECK(CRS_CREDIT IN (0,1,2,3,4,5,6,7,8)), CLASS_TIME
/* create the CLASS table */ CREATE TABLE CLASS( CLASS_CODE DECIMAL(5,0) NOT NULL, CRS_CODE VARCHAR(8) NOT NULL, CLASS_SECTION INTEGER NOT NULL CHECK(CRS_CREDIT IN (0,1,2,3,4,5,6,7,8)), CLASS_TIME VARCHAR(25) NOT NULL, CLASS_ROOM CHAR(6), PRIMARY KEY (CLASS_CODE), CONSTRAINT FK_CRS_CODE FOREIGN KEY(CRS_CODE) REFERENCES COURSE(CRS_CODE) );
When I run this I get: ORA-02438: Column check constraint cannot reference other columns in Oracle. How do I fix
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
