Skip to main content

SQL

Linter and auto-formatter: https://github.com/sqlfluff/sqlfluff

https://www.sqlstyle.guide/

https://www.metabase.com/learn/sql-questions/sql-best-practices

https://hakibenita.com/sql-for-data-analysis

https://fagnerbrack.com/learn-sql-once-use-it-for-30-years-9aceb0bdee03 - Learn SQL Once, Use It for 30 Years - https://news.ycombinator.com/item?id=48347483

SQL endures because relational algebra is mathematics, and mathematics does not have release cycles.

https://animatesql.com/

Components of the SQL language [source](from https://www.linkedin.com/posts/alexxubyte_systemdesign-coding-interviewtips-activity-7046145129413255168-VvqB/):

  • DDL: data definition language, such as CREATE, ALTER, DROP
  • DQL: data query language, such as SELECT
  • DML: data manipulation language, such as INSERT, UPDATE, DELETE
  • DCL: data control language, such as GRANT, REVOKE
  • TCL: transaction control language, such as COMMIT, ROLLBACK

https://pragprog.com/titles/bksap2/more-sql-antipatterns/

Reserved words

https://en.wikipedia.org/wiki/SQL_reserved_words

https://stackoverflow.com/questions/695578/creating-table-names-that-are-reserved-words-keywords-in-ms-sql-server

Cheatsheet

https://www.freecodecamp.org/news/basic-sql-commands/

https://www.freecodecamp.org/news/learn-sql-in-10-minutes/ (MySQL)

https://www.dataquest.io/blog/sql-commands/

https://learnsql.com/blog/sql-basics-cheat-sheet/ (PDF)

SELECT *

https://stackoverflow.com/questions/65512/which-is-faster-best-select-or-select-column1-colum2-column3-etc

https://tanelpoder.com/posts/reasons-why-select-star-is-bad-for-sql-performance/

Schema design

https://www.mikealche.com/software-development/a-humble-guide-to-database-schema-design