File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Sql Notes And Cheatsheet
2
2
3
- ## Coding Standreds
3
+ ## Coding Standards
4
4
1 . Use [ ] brackets to specify coloumn name in select statement.
5
5
2 . Do not use SELECT * as it affects significant performance.
6
6
For. Eg. SELECT ** [ ID] **
20
20
** ,** [ NAME]
21
21
** ,** [ SALARY]
22
22
from Employees;
23
+ 6 . Execution of query should be fast so write query likewise.
24
+ 7 . Proper Indentation should be followed while writing the query.
25
+ 8 . Define Aliases to change column name to your convenient name. Used to shorten Column Names of Coulmns having large names.
26
+ 9 . ** 'AS'** keyword is used to define aliases.
27
+ For. Eg. SELECT ** [ Department Name] ** AS ** [ DeptName] **
28
+ from Employees;
29
+ 10 . First Character of Identifier should start with ** (_ ), (@), #** .
30
+ 11 . Do not use Reserved keywords for identifiers.
31
+ 12 . Not to use embedded special or supplementary characters.
32
+ 13 . When keyword & column name are same use square bracket to use column name in query.
33
+ For. Eg. SELECT [ NAME]
34
+ , ** [ DATE] **
35
+ from Employees;
36
+ 14 . Temporary Table can be created using #, ## or Table Variable.
37
+ 15 . ** ;** should be specified at the termination of every statement.
38
+ 16 . ** ;** always required for Common Table Expressions and Service Broker Commands.
You can’t perform that action at this time.
0 commit comments