U
U
Urukhayy2015-10-17 15:12:28
Programming
Urukhayy, 2015-10-17 15:12:28

Would it make sense to store gender as a string in a MySQL database?

Would it make sense for MySQL to store gender as a string (male/female) rather than 0 for male and 1 for female?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
T
Timur Shemsedinov, 2015-10-17
@MarcusAurelius

The great secret of programming architecture is that 0 for female and 1 for male.

R
Rsa97, 2015-10-17
@Rsa97

No. If you really want to, then store it as ENUM('male', 'female').

A
Alejandro Esquire, 2015-10-17
@A1ejandro

Of course, it is advisable if you have a number of sexes significantly more than two =)))) And if there are still two, then no ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question