Skip to content

Commit

Permalink
Merge pull request #12 from Prerna-Chachare/patch-6
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
thedevankit-0 authored Jul 20, 2019
2 parents 926723b + 884858c commit cfac6cc
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@
## Coding Standards
1. Use [ ] brackets to specify coloumn name in select statement.
2. Do not use SELECT * as it affects significant performance.
For. Eg. SELECT * from Employees;
For. Eg.
```sql
SELECT * from Employees;
```
3. Select query should have SELECT keyword in Capital Letters.
For. Eg. **SELECT** [ID]
, [NAME]
from Employees;
4. Specify column name on seperate lines.
For. Eg. SELECT [ID]
For. Eg.
```sql
SELECT [ID]
**, [NAME]**
**, [SALARY]**
from Employees;
```
5. Comma seperator should be before the start of new column name.
For. Eg. SELECT [ID]
**,** [NAME]
Expand All @@ -22,15 +28,21 @@
7. Proper Indentation should be followed while writing the query.
8. Define Aliases to change column name to your convenient name. Used to shorten Column Names of Coulmns having large names.
9. **'AS'** keyword is used to define aliases.
For. Eg. SELECT **[Department Name]** AS **[DeptName]**
For. Eg.
```sql
SELECT **[Department Name]** AS **[DeptName]**
from Employees;
```
10. First Character of Identifier should start with **(_), (@), #**.
11. Do not use Reserved keywords for identifiers.
12. Not to use embedded special or supplementary characters.
13. When keyword & column name are same use square bracket to use column name in query.
For. Eg. SELECT [NAME]
For. Eg.
``` sql
SELECT [NAME]
, **[DATE]**
from Employees;
```
14. Temporary Table can be created using #, ## or Table Variable.
15. **';'** should be specified at the termination of every statement.
16. **';'** always required for Common Table Expressions and Service Broker Commands.
Expand All @@ -39,13 +51,18 @@
19. Entity name should be plural.
20. Primary key should be NOT NULL AND AUTO_INCREMENT.
21. While inserting values in table
1. Don't insert the value of auto incremented columun.
2. Inserting values should be in same case it means data should be consistant.
22 .While creating table obey all the rules of Normal Forms.
23 .Explicitly specify the order of column Like ASC or DESC.
24 .View name should start with 'V'
Ex.[vEmployee]
- Don't insert the value of auto incremented columun.
- Inserting values should be in same case it means data should be consistant.
22. While creating table obey all the rules of Normal Forms.
23. Explicitly specify the order of column Like ASC or DESC.
24. View name should start with 'V'.
Ex. [vEmployee]

25. Schema should be required for tables.
26. All predefine clauses name sholud be in capital letters.
Ex. FROM,SELECT etc.

0 comments on commit cfac6cc

Please sign in to comment.