I'm creating my first mysql script and want to create a table with column 'type'. it should has only two possible values: 'XYZ' and 'ABC', so I made:
CREATE TABLE table(
type varchar(12) NOT NULL,
CHECK (type = 'XYZ' or type = 'ABC');
But when i'm testing and inserting values like 234 or 'John' it's working and doesn't return any errors. I think it shouldn't insert value 'John', is it?