I am trying to create a simple table with a few columns. I would like to add a check constraint to one of the columns, see below:
create table jobs (
JOB_ID varchar(10) not null,
JOB_TITLE varchar(35) not null,
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
CHECK(MAX_SALARY<=25000)
);
This returns an error for the CHECK
line.
A comma or closing bracket was expected. (near CHECK)
If I add a comma like to the previous line; MAX_SALARY decimal(6,0),
, I am returned with more errors:
A symbol name was expected! A reserved keyword can not be used as a column name without backquotes.
Unexpected beginning of statement near MAX_SALARY
Unexpected beginning of statement near 25000