Hello, Can you help me with this simple create table command?

  • I am trying to create a check command that ensures only A'B','c','D','E','F','G and s1, s2 can be inserted in the table, is this even applicable?

    Heres my crappy code haha:

    Create Table GRADE (

    GradeVARCHAR2(1) CONSTRAINT pk_Grade PRIMARY KEY

    CONSTRAINT check_grade

    CHECK (substr(Grade = 'A','B','c','D','E','F','G')),

    Salary_Scale VARCHAR2(2) CONSTRAINT check_SScale

    CHECK (substr(Salary_Scale = 'S1', 'S2')),

    )

    /

  • Grade IN ('A','B','c','D','E','F','G')

    etc

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply