Naming of boolean column in database table
Sql ServerDatabaseDatabase DesignNaming ConventionsSql Server Problem Overview
I have 'Service' table and the following column description as below
- Is User Verification Required for service ?
- Is User's Email Activation Required for the service ?
- Is User's Mobile Activation required for the service ?
I Hesitate in naming these columns as below
IsVerificationRequired
IsEmailActivationRequired
IsMobileActivationRequired
or
RequireVerification
RequireEmailActivation
RequireMobileActivation
I can't determined which way is the best .So, Is one of the above suggested name is the best or is there other better ones ?
Sql Server Solutions
Solution 1 - Sql Server
I would (and do) use "IsVerificationRequired"
I try to add some meaning to my column names so it's obvious (ValueDate, InsertedDateTime, IsActive, HazCheezBurger, ProductName etc). "Isxxxx" implies yes/no for example without thinking and you only have 2 states unlike "ProductName".
Solution 2 - Sql Server
Run with the Is
variants, or at the very least swap the Require
to Requires
. Booleans should be phrased as questions. Is, Can, Has, Should, they're all good prefixes for Boolean functions/columns. See 1370840 for more arguments on this
Solution 3 - Sql Server
I would choose VerificationRequired, EmailActivationRequired etc.
Database is the snapshot of the state, so the above said column names goes better over the ones you have mentioned in my opinion.
Solution 4 - Sql Server
I would go for the one that fits more the syntax you are using in your current project. Either one is fine since they describe what the variable contains, the only thing you need to worry about is that you keep the same naming standard for all your project. If you haven't decide any naming standard for your project yet, the first one would be better since it is what is closer of the Java Bean naming standard which is something that a lot of developer are used to.