CodePudding user response:
Use the testThe create table students
(sname nvarchar (50),
Ssex char (2),
Shobby nvarchar (50)
)
The ALTER TABLE students WITH NOCHECK
ADD the CONSTRAINT col1_check CHECK (ssex in (' male ', 'woman'))
The ALTER TABLE students WITH NOCHECK
ADD the CONSTRAINT col2_check CHECK (shobby in (' basketball ', 'football', 'music', 'read', 'drawing', 'photography'))
Behind two statements as constraint, I don't know the rules restricting field is content with the requirement, if you say this, gender limit the men and women, hobby is limiting the six, write so that is no problem,
CodePudding user response:
Table is to create a success, but two days later statement syntax error