0
CREATE TABLE STUDENT (
ST_ID NUMBER(2) PRIMARY KEY NOT NULL,
S_ID NUMBER(2) NOT NULL,
ST_FULL_NAME CHAR(25),
ST_GENDER CHAR(1) NOT NULL,
ST_AGE NUMBER(2),
ST_EMAIL VARCHAR(20) CHECK(ST_EMAIL LIKE ‘%@%’),
ST_GDATE DATE,
FOREIGN KEY (S_ID) REFERENCES STAFF,
CONSTRAINT STUDENT_CK_ST_GENDER CHECK (ST_GENDER IN ('M','F')),
CONSTRAINT STUDENT_CK_ST_GDATE CHECK (ST_GDATE > 01-JAN-2014));  --<-- constraint

I am stuck on the last constraint. Every time I get a message saying "JAN" invalid identifier.

Can anybody please identify the mistake and correct it for me?

1
  • 2
    Use the quote in this way: '01-JAN-2014' Commented Mar 21, 2014 at 21:43

1 Answer 1

4
CONSTRAINT STUDENT_CK_ST_GDATE CHECK (ST_GDATE > TO_DATE('20140101','YYYYMMDD'))
Sign up to request clarification or add additional context in comments.

1 Comment

THANKS, YOU HAVE BEEN A GREAT HELP. IV BEEN STUCK IN THIS FOR AGES.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.