mirror of
https://github.com/treffynnon/sqlstyle.guide.git
synced 2025-03-09 12:49:51 -05:00
Translated General: Do / Aviod
This commit is contained in:
parent
8b9bea7311
commit
741138e09c
1 changed files with 24 additions and 23 deletions
|
@ -22,21 +22,22 @@ O Guia De Estilo SQL por [Simon Holywell][simon] é licenciaso sob a
|
||||||
[Creative Commons Attribution-ShareAlike 4.0 International License][licence].
|
[Creative Commons Attribution-ShareAlike 4.0 International License][licence].
|
||||||
Baseado no trabalho em [http://www.sqlstyle.guide][sqlstyleguide].
|
Baseado no trabalho em [http://www.sqlstyle.guide][sqlstyleguide].
|
||||||
|
|
||||||
## General
|
## Geral
|
||||||
|
|
||||||
### Do
|
### Faça
|
||||||
|
|
||||||
* Use consistent and descriptive identifiers and names.
|
* Utilize identificadores e nomes consistentes e descritivos.
|
||||||
* Make judicious use of white space and indentation to make code easier to read.
|
* Faça uso criterioso de espaços em branco e indentação para tornar o código
|
||||||
* Store [ISO-8601][iso-8601] compliant time and date information
|
mais fácil de ler.
|
||||||
(`YYYY-MM-DD HH:MM:SS.SSSSS`).
|
* Armazene informações de data e hora compatíveis com [ISO-8601][iso-8601]
|
||||||
* Try to use only standard SQL functions instead of vendor specific functions for
|
(`YYYY-MM-DD HH:MM:SS.SSSSS`).
|
||||||
reasons of portability.
|
* Por questões de portabilidade, tente utilizar apenas funções SQL padrão ao
|
||||||
* Keep code succinct and devoid of redundant SQL—such as unnecessary quoting or
|
invés de funções específicas de servidores SQL de empresas.
|
||||||
parentheses or `WHERE` clauses that can otherwise be derived.
|
* Mantenha o código sucinto e desprovido de SQL redundante - como adição de
|
||||||
* Include comments in SQL code where necessary. Use the C style opening `/*` and
|
aspas e parênteses desencessários, ou cláusulas WHERE que podem ser derivadas.
|
||||||
closing `*/` where possible otherwise precede comments with `--` and finish
|
* Inclua comentários no código SQL quando necessário. Utilize o estilo C abrindo
|
||||||
them with a new line.
|
com `/*` e fechando com `*/` onde possível. Onde não for possível, preceda os
|
||||||
|
comentários com `--` e termine com uma nova linha.
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
SELECT file_hash -- stored ssdeep hash
|
SELECT file_hash -- stored ssdeep hash
|
||||||
|
@ -51,17 +52,17 @@ UPDATE file_system
|
||||||
WHERE file_name = '.vimrc';
|
WHERE file_name = '.vimrc';
|
||||||
```
|
```
|
||||||
|
|
||||||
### Avoid
|
### Evite
|
||||||
|
|
||||||
* CamelCase—it is difficult to scan quickly.
|
* CamelCase—é dificil para efetuar buscas rapidamente.
|
||||||
* Descriptive prefixes or Hungarian notation such as `sp_` or `tbl`.
|
* Prefixos descritivos ou notação Húngara como `sp_` ou `tbl`.
|
||||||
* Plurals—use the more natural collective term where possible instead. For example
|
* Plurais—utilize um termo coletivo onde possível. Por exemplo,
|
||||||
`staff` instead of `employees` or `people` instead of `individuals`.
|
`pessoal` ao invés de `funcionários` ou `pessoa` no lugar de `indivíduos`.
|
||||||
* Quoted identifiers—if you must use them then stick to SQL92 double quotes for
|
* Identificadores entre aspas-se você precisar utilizá-los, então utilize a as
|
||||||
portability (you may need to configure your SQL server to support this depending
|
aspas duplas SQL92 por questões de portabilidade (dependendo da desenvolvedora,
|
||||||
on vendor).
|
pode ser necessário configurar seu servidor SQL para suportar isso).
|
||||||
* Object oriented design principles should not be applied to SQL or database
|
* Princípios de design orientado a objetos não devem ser aplicados ao SQL ou
|
||||||
structures.
|
a estrutura de bancos de dados.
|
||||||
|
|
||||||
## Naming conventions
|
## Naming conventions
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue