Difference between revisions of "Database 101"
From kemiko
(Created page with "* Always do a "select" before a "delete" * Rename objects before deleting * Always use a "where" clause..."where 1" or "where 1 = 1" for all * Self joins can be handy * Use AN...") |
|||
Line 1: | Line 1: | ||
* Always do a "select" before a "delete" | * Always do a "select" before a "delete" | ||
* Rename objects before deleting | * Rename objects before deleting | ||
− | * Always use a "where" clause..."where 1" or "where 1 = 1" for all | + | * Always use a "where" clause..."where 1" or "where 1 = 1" for all queryies or add a comment to make it clear that the query is selecting everything |
* Self joins can be handy | * Self joins can be handy | ||
* Use ANSI joins for clarity | * Use ANSI joins for clarity | ||
+ | * Format SQL to for consistency and readability |
Latest revision as of 20:39, 26 November 2017
- Always do a "select" before a "delete"
- Rename objects before deleting
- Always use a "where" clause..."where 1" or "where 1 = 1" for all queryies or add a comment to make it clear that the query is selecting everything
- Self joins can be handy
- Use ANSI joins for clarity
- Format SQL to for consistency and readability