treffynnon/sqlstyle.guide

Naming convention for boolean columns

vanillajonathan opened this issue · 3 comments

How should boolean columns be named?

Should they have any prefix or suffix such as "has", "can", "is" or should that be avoided?

Example "admin" could be "is_admin".

I wouldn't include the prefix here. The column type is clear that there are only two possible values - true and false - so I would call the column admin or enabled or whatever.

Okay, but date columns have the "date" suffix which could be argued that isn't needed since it should be clear what values are possible because of the column type.

Agreed. That is there for compatibility with the book from memory.