How do I make a constraint in a table for a field (CHAR(20)) that it may only accept, for example, "car" or "bike".
CREATE TABLE Things (
id INTEGER NOT NULL,
thing CHAR(30) NOT NULL,
PRIMARY KEY (id),
CONSTRAINT thingcheck CHECK (thing = "car" OR thing = "bike")
);
If I insert (1, "laptop") it still inserts! Any ideas?
Thanks very much for your time.
--- EDIT ---
As John pointed out, MySQL ignored CHECK clauses. Thanks!