sql - MySQL data type for a field with only two possible options -


i'm trying work out data type use field in database can 1 of 2 options: 'dual' or 'solo'.

i realise boolean can't use tinyint(1) because inputs not numbers.

if give me idea of use in situation appreciated :)

you can use enum

colname enum('dual', 'solo') 

internally stored tinyint, when storing , retrieving use strings.

or use tinyint. terms "dual" , "solo" refer 2 , 1 participants, have

participants tinyint(1) 

and store 1 solo , 2 dual.


Comments

Popular posts from this blog

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

python 2.7 - Lines in my code being skipped and I am not sure why -

python - multiprocessing pool with map -