0

I was running this SQL create table in access 2016 database but I get syntax error in CONSTRAINT clause. It appears correct to me. What may be the error in the constraint clause.

CREATE  TABLE COMPUTER( 
SerialNumber Number NOT NULL,

Make Text(12) NOT NULL,

Model Text(24) NOT NULL,

ProcessorType Text(24) NULL,

ProcessorSpeed Number NOT NULL,

MainMemory Text(15) NOT NULL,

DiskSize Text(15) NOT NULL,

primary key(SerialNumber),

CONSTRAINT MAKE_CHECK (Make IN ('Dell', 'Gateway', 'HP', 'Other')),


CONSTRAINT SPEED_CHECK CHECK(ProcessorSpeed BETWEEN 1.0 AND 4.0))
MIRTY
  • 3
  • 3
  • 1
    Possible duplicate of [Check Constraints in Access](https://stackoverflow.com/questions/27980784/check-constraints-in-access) – Erik A Nov 14 '18 at 12:28
  • Plus what Gustav said, but I consider that a typo since the second line shows you do know the correct syntax – Erik A Nov 14 '18 at 12:28

1 Answers1

1

Use the correct syntax:

CONSTRAINT MAKE_CHECK CHECK(Make IN ('Dell', 'Gateway', 'HP', 'Other')),
Gustav
  • 53,498
  • 7
  • 29
  • 55