mirror of
https://github.com/treffynnon/sqlstyle.guide.git
synced 2025-03-09 12:49:51 -05:00
Updated the README
Updated the README document to be the final version to be submitted for review
This commit is contained in:
parent
036e12ce1c
commit
6b841cf32e
1 changed files with 15 additions and 27 deletions
42
README.md
42
README.md
|
@ -2,23 +2,7 @@
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
You can use this set of guidelines, [fork them][fork] or make your own - the
|
This document is a work in progress to generate a SQL query style guide for use in our department
|
||||||
key here is that you pick a style and stick to it. To suggest changes
|
|
||||||
or fix bugs please open an [issue][issue] or [pull request][pull] on GitHub.
|
|
||||||
|
|
||||||
These guidelines are designed to be compatible with Joe Celko's [SQL Programming
|
|
||||||
Style][celko] book to make adoption for teams who have already read that book
|
|
||||||
easier. This guide is a little more opinionated in some areas and in others a
|
|
||||||
little more relaxed. It is certainly more succinct where [Celko's book][celko]
|
|
||||||
contains anecdotes and reasoning behind each rule as thoughtful prose.
|
|
||||||
|
|
||||||
It is easy to include this guide in [Markdown format][dl-md] as a part of a
|
|
||||||
project's code base or reference it here for anyone on the project to freely
|
|
||||||
read—much harder with a physical book.
|
|
||||||
|
|
||||||
SQL style guide by [Simon Holywell][simon] is licensed under a [Creative Commons
|
|
||||||
Attribution-ShareAlike 4.0 International License][licence].
|
|
||||||
Based on a work at [http://www.sqlstyle.guide][sqlstyleguide].
|
|
||||||
|
|
||||||
## General
|
## General
|
||||||
|
|
||||||
|
@ -37,29 +21,33 @@ Based on a work at [http://www.sqlstyle.guide][sqlstyleguide].
|
||||||
them with a new line.
|
them with a new line.
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
SELECT file_hash -- stored ssdeep hash
|
SELECT
|
||||||
FROM file_system
|
file_hash -- stored ssdeep hash
|
||||||
WHERE file_name = '.vimrc';
|
FROM
|
||||||
|
file_system
|
||||||
|
WHERE
|
||||||
|
file_name = '.vimrc';
|
||||||
```
|
```
|
||||||
```sql
|
```sql
|
||||||
/* Updating the file record after writing to the file */
|
/* Updating the file record after writing to the file */
|
||||||
UPDATE file_system
|
UPDATE
|
||||||
SET file_modified_date = '1980-02-22 13:19:01.00000',
|
file_system
|
||||||
file_size = 209732
|
SET
|
||||||
WHERE file_name = '.vimrc';
|
file_modified_date = '1980-02-22 13:19:01.00000',
|
||||||
|
file_size = 209732
|
||||||
|
WHERE
|
||||||
|
file_name = '.vimrc';
|
||||||
```
|
```
|
||||||
|
|
||||||
### Avoid
|
### Avoid
|
||||||
|
|
||||||
* Plurals—use the more natural collective term where possible instead. For example
|
|
||||||
`staff` instead of `employees` or `people` instead of `individuals`.
|
|
||||||
* Object oriented design principles should not be applied to SQL or database
|
* Object oriented design principles should not be applied to SQL or database
|
||||||
structures.
|
structures.
|
||||||
|
|
||||||
## Naming conventions
|
## Naming conventions
|
||||||
|
|
||||||
### All Naming Conventions
|
### All Naming Conventions
|
||||||
* See Confluence documentation for [Ives Database Design Guide][design-guide]
|
* See Confluence documentation for [Ives Database Design Guide][design-guide] when creating new tables or altering existing tables for the complete naming conventions to be used.
|
||||||
|
|
||||||
### Aliasing or correlations
|
### Aliasing or correlations
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue