What naming conventions are in mysql database creation, tables and columns

Asked

Viewed 1,326 times

3

I would like to know what kind of conventions exist in the names assigned to the database, tables and columns in mysql, is usually used camelCase or other type of convention?

  • The bank doesn’t force you to standardize.

  • @lost, yes I know, but there is some convention?

  • Usually the frameworks are the ones who impose conventions, if you are using a follow her. Only avoid using reserved words as column/table names, for example desc to a field descricao

  • Dude, take a look at my answer, it might help you.

1 answer

4


Mysql is not Case sensitive in Windows, so regardless of the "case" of the table creation, you can always access it by Tabela1 or TABELA1, the same happens with the columns.

What does not happen with Linux, which is Case Sensitive.

Although it is configurable (see how in: https://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html)

What I suggest is to use nomenclature that is ideal independent of the platform (Windows or Linux) and Mysql configuration:

Table names:

PEDIDO_DE_VENDA

PEDIDO_DE_VENDA_PRODUTO

CLIENTES_ENDERECOS

And for columns:

PEDIDO_ID, NUM_ENDERECO, VALOR_UNITARIO

Browser other questions tagged

You are not signed in. Login or sign up in order to post.