CHECK constraint to restrict the registration date to dates after August 26, 2005

后端 未结 2 1044
一向
一向 2021-01-28 04:32

Need some help with this:

Create a table called TEMP_STUDENT with the following columns and constraints: a column STUD_ID for the student ID and is the

2条回答
  •  感情败类
    2021-01-28 04:48

    Try this

    CREATE TABLE Temp_Student
    (STUD_ID NUMBER (8,0),
    FIRST_NAME VARCHAR2(25) NOT NULL,
    LAST_NAME VARCHAR2(25) NOT NULL,
    ZIP VARCHAR2(5),
    REGISTRATION_DATE DATE NOT NULL,
    CONSTRAINT STUD_ID_PK PRIMARY KEY(STUD_ID),
    CONSTRAINT ZIP_FK FOREIGN KEY (ZIP)
    REFERENCES ZIPCODE (ZIP),
    CONSTRAINT chk_REGISTRATION_DATE CHECK (REGISTRATION_DATE> TO_DATE('26-AUGUST-2005'))
    )
    

提交回复
热议问题