1
0
Fork 0
mirror of https://github.com/treffynnon/sqlstyle.guide.git synced 2025-03-09 12:49:51 -05:00

Adding Translations

- Create syntax
- Specifying default values
This commit is contained in:
Unknown 2017-04-17 11:45:41 -03:00
parent d67bbf968b
commit 413b494f5f

View file

@ -325,28 +325,29 @@ SELECT CASE postcode
AND postcode IN ('EH1', 'BN1', 'NN1', 'KW1') AND postcode IN ('EH1', 'BN1', 'NN1', 'KW1')
``` ```
## Create syntax ## Sintaxe Create
When declaring schema information it is also important to maintain human Enquanto declarando informação do schema, é importante manter código legível
readable code. To facilitate this ensure the column definitions are ordered and por humanos. Para facilitar isso, tenha certeza que as definições das colunas
grouped where it makes sense to do so. estão ordenadas e agrupadas onde fizer sentido.
Indent column definitions by four (4) spaces within the `CREATE` definition. Indente definições de coluna com quatro (4) espaços dentro da definição `CREATE`.
### Choosing data types ### Escolhendo tipos de dados
* Where possible do not use vendor specific data types—these are not portable and * Onde possível, não utilize tipos de dados específicos de certos tipos de banco
may not be available in older versions of the same vendor's software. de dados—eles não são portáteis e podem não estar disponíveis em versões antigas
* Only use `REAL` or `FLOAT` types where it is strictly necessary for floating do mesmo banco de dados.
point mathematics otherwise prefer `NUMERIC` and `DECIMAL` at all times. Floating * Apenas utilize os tipos `REAL` ou `FLOAT` onde é estritamente necessário para
point rounding errors are a nuisance! utilizar pontos flutuantes, do contrário prefira sempre `NUMERIC` e `DECIMAL`.
Erros de ponto flutuante são um transtorno!
### Specifying default values ### Especificando valores padrão
* The default value must be the same type as the column—if a column is declared * O valor padrão deve ser do mesmo tipo da coluna—se uma coluna foi declarada
a `DECIMAL` do not provide an `INTEGER` default value. como `DECIMAL`, não forcena um `INTEGER` como valor padrão.
* Default values must follow the data type declaration and come before any * Valores padrão devem seguir a mesma declaração do tipo de dados e vir antes
`NOT NULL` statement. de qualquer `NOT NULL`.
### Constraints and keys ### Constraints and keys