Answer the question
In order to leave comments, you need to log in
How to check the value of a string?
I need to remember the gender of a person, so I add another column.
Because there will not be more than 2 genders on the site I want to check the line for a match (male or famale).
In my opinion it should look like this:
ALTER TABLE product ADD COLUMN gender VARCHAR(6) CHECK ('male' or 'female');
Answer the question
In order to leave comments, you need to log in
Using VARCHAR(6) for the gender field is not rational. Use ENUM('mail'. 'femail') or even BOOLEAN
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question