filmov
tv
TOP10 #sql #sqlserver #database #dba #data #dataengineering #dataanalytics #datascience #programming

Показать описание
Here are TOP 10 best practices for SQL SERVER:
1. Save a backup before Data Manipulation;
2. Don't use UNION for 2 tables with no duplicates, use UNION ALL;
3. Write all SQL keywords with UPPERCASE letters.
4. For better readability, use CTEs instead of subqueries;
5. Never use SELECT *, mention the needed columns in the SELECT clause;
6. Use table aliases with columns when you are joining multiple tables;
7. Before writing a query, understand the data distribution in your tables;
8. Always add comments about the complex parts.
9. For better readability, write the JOIN condition in the ON clause not in the WHERE clause;
10. Never use order by in sub queries , It will unnecessary increase runtime.
Missed something? Let us know in comments 🦸♂️🦸♀️!
#sql #sqlserver #data #dataanalytics #database #ssms #dba #dataengineering
1. Save a backup before Data Manipulation;
2. Don't use UNION for 2 tables with no duplicates, use UNION ALL;
3. Write all SQL keywords with UPPERCASE letters.
4. For better readability, use CTEs instead of subqueries;
5. Never use SELECT *, mention the needed columns in the SELECT clause;
6. Use table aliases with columns when you are joining multiple tables;
7. Before writing a query, understand the data distribution in your tables;
8. Always add comments about the complex parts.
9. For better readability, write the JOIN condition in the ON clause not in the WHERE clause;
10. Never use order by in sub queries , It will unnecessary increase runtime.
Missed something? Let us know in comments 🦸♂️🦸♀️!
#sql #sqlserver #data #dataanalytics #database #ssms #dba #dataengineering