You can’t say without understanding what you really want, without knowing the whole context.
I’d say it’s better to wear one int
or even a smaller integer type since there are only 6 options.
I don’t think it is desirable to have the text space occupied in the table. But the worst problem is if you have to rename one of these types. It may be useful to do this.
This is considered an enumeration and some databases have their own way of dealing with it. But it is common to be more advantageous to have a normalized table with the descriptions. Of course the normalization generates some extra cost, but if everything goes well it will be in the cache and the cost will be very small. But it may be exaggeration to do this.
The problem to deal with in the application is that if you need to change a name, or add a new type, you will have to deal with it properly, not everyone knows how to do it correctly. But it is far from wrong. It may be the simplest solution.
Risks always exist in each of these solutions. If you do wrong any one may not work right. But none have obvious risks even doing right.
Take a look:
You can use type as ENUM or SET
– Williams
Normally use
tinyint()
.– Daniel Omine
@Cool joker, didn’t know these guys, I’ll take a look, thanks. Daniel, thanks for the tip.
– Fernando Zabin