- Use [ ] brackets to specify coloumn name in select statement.
- Do not use SELECT * as it affects significant performance. For. Eg. SELECT [ID] , [NAME] from Employees;
- Select query should have SELECT keyword in Capital Letters. For. Eg. SELECT [ID] , [NAME] from Employees;
- Specify column name on seperate lines. For. Eg. SELECT [ID] , [NAME] , [SALARY] from Employees;
- Comma seperator should be before the start of new column name. For. Eg. SELECT [ID] , [NAME] , [SALARY] from Employees;
- Execution of query should be fast so write query likewise.
- Proper Indentation should be followed while writing the query.
- Define Aliases to change column name to your convenient name. Used to shorten Column Names of Coulmns having large names.
- 'AS' keyword is used to define aliases. For. Eg. SELECT [Department Name] AS [DeptName] from Employees;
- First Character of Identifier should start with (_), (@), #.
- Do not use Reserved keywords for identifiers.
- Not to use embedded special or supplementary characters.
- When keyword & column name are same use square bracket to use column name in query. For. Eg. SELECT [NAME] , [DATE] from Employees;
- Temporary Table can be created using #, ## or Table Variable.
- ';' should be specified at the termination of every statement.
- ';' always required for Common Table Expressions and Service Broker Commands.
-
Notifications
You must be signed in to change notification settings - Fork 6
thedevankit-0/Sql_Notes
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published