Absolutely.
snake_case
for your table names. e.g. Yes: user_privilege
No: userPrivilege
No: UserPrivilege
No: User
.user
No: users
If you’re using a database engine that follows the ANSI SQL standard (Postgres, MySQL, and most other RDBMS) use snake_case
for your tables and your columns. The standard (source pending) indicates that all table and column names are folded into lowercase. Thus, table names like UserPrivileges
that use pascal case or even userPrivileges
are folded down into userpriviliges
. This ultimately leads to very annoying bugs where queries and DDLs must be written while handling cases by quoting them. Particularly because single quotes and double quotes have different meanings to many SQL engines.
There’s an argument to be made if you’re using a “batteries included” framework like rails.