enum('yes', 'no') vs tinyint — which one to use?

后端 未结 3 1525
有刺的猬
有刺的猬 2021-01-04 01:44

What\'s the best practice for fields that hold true/false values?

Such columns can be defined as enum(\'yes\',\'no\') or as tinyint(1). Is one better/faster than the

3条回答
  •  时光说笑
    2021-01-04 02:27

    Also, ENUM is a non-standard MySql extension. You should avoid it, especially if you can achieve the same results in a standard way.

提交回复
热议问题