←back to thread

SQL Design Patterns (2010)

(vadimtropashko.wordpress.com)
149 points mci | 1 comments | | HN request time: 0s | source
Show context
alphazard ◴[] No.45077668[source]
I always tell people to worry about the data structures that you want the database to maintain for you, and not worry about the SQL. You can always use Google to look up the SQL, or now ChatGPT to generate it for you. SQL is a not-that-great language and it intentionally hides what's going on. It is also different enough between databases that you need to pay attention. So learning to design/think in terms of SQL is probably not worth doing.

The set of data structures that you use to model and index a dataset is worth understanding, and designing in that space is a skill worth learning.

replies(4): >>45078199 #>>45078627 #>>45078711 #>>45081027 #
1. baq ◴[] No.45081027[source]
You’re kinda right, but designing for a particular RDBMS with awareness of queries which will be performed thus indexes necessary (…or not ;) is really not that far away from what you propose. The only issue is beginner SQL learning material says ‘it’s declarative, don’t worry about what’s happening as long as you get a good result’ and that just isn’t true in any non-trivial applications of SQL.