I would like to restrict a column value in a SQL table. For example, the column values can only be \"car\" or \"bike\" or \"van\". My question is how do you achieve this in
You would use a check constraint. In SQL Server it works like this
ALTER TABLE Vehicles ADD CONSTRAINT chkVehicleType CHECK (VehicleType in ('car','bike','van'));
I'm not sure if this is ANSI standard but I'm certain that MySQL has a similar construct.