MySQL Forums
Forum List  »  Newbie

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'))

Options: ReplyQuote


Subject
Written By
Posted
The Check Command - MySQL?
March 24, 2015 02:30PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.