The Check Command - MySQL?
Posted by:
Gwen White
Date: March 24, 2015 02:30PM
I was wondering if there is such a thing as the CHECK command in MySQL. It is in SQL but when I go to use it in MySQL it doesn't work. This is the code I have for MySQL that is supposed to work but it isn't.
CREATE TABLE STORE (
StoreID Int NOT NULL IDENTITY (1000, 50),
StoreName Char(50) NOT NULL,
City Char(35) NOT NULL,
Country Char(50) NOT NULL,
Phone Char(16) NOT NULL,
Fax Char(16) NULL,
EmailAddress Char(100) NULL,
Contact Char(50) NOT NULL,
CONSTRAINT Store_PK PRIMARY KEY(StoreID),
CONSTRAINT StoreCountry CHECK
(Country IN ('Hong Kong', 'India',
'Japan', 'Peru','Philippines', 'Singapore',
'United States'))