This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-02
Channels
- # ai (1)
- # aleph (16)
- # announcements (1)
- # architecture (51)
- # babashka (32)
- # beginners (27)
- # calva (3)
- # clerk (1)
- # clojure (49)
- # clojure-art (1)
- # clojure-denver (6)
- # clojure-europe (70)
- # clojure-nl (1)
- # clojure-norway (56)
- # clojure-uk (2)
- # clojuredesign-podcast (4)
- # clojurescript (57)
- # clr (15)
- # community-development (3)
- # conjure (1)
- # core-async (10)
- # data-science (1)
- # datalog (2)
- # datomic (3)
- # emacs (12)
- # events (1)
- # gratitude (4)
- # honeysql (9)
- # hyperfiddle (86)
- # jobs (4)
- # off-topic (10)
- # pedestal (5)
- # portal (11)
- # practicalli (2)
- # reitit (7)
- # releases (3)
- # remote-jobs (1)
- # sql (15)
- # tools-build (8)
- # xtdb (4)
Does all things SQL include… how to get better at SQL? What courses/books/video tutorials do you guys suggest to elevate your SQL foo?
Very interesting! From my 1 minute scan, thats about perf, right? I am also very interested in writing more advanced queries
Yea, true. For learning about more advanced queries, I read/skimmed a few books such as this: https://www.amazon.com/T-SQL-Window-Functions-Developer-Reference-dp-0135861446/dp/0135861446/ref=dp_ob_title_bk Though that one is is for SQL Server, not sure what you use.
But lately I'm not sure it is worth it, because it seems performance falls over so easily for complex queries
Postgres. Ironically I’ve been looking at whether we can leverage the database more :’).
I found https://theartofpostgresql.com very helpful
I think that a curious mindset is valuable too. Asking “I wonder if I could do this in my database rather than in my application code” gets you a long way .
Getting familiar with PARTITION BY
, common table expressions, remembering that you can have sub-queries almost all over the place are things that might help
eg select (select bar from foo where foo.id = id) from baz where qix = 'qux'
is an example of a neat trick which lets you write more composable queries which is a huge win when working with #C66EM8D5H
Remember that asking yourself "can I do this on my database" the answer usually is "yes", so try to not fall too deep into a rabbit hole, like trying to solve the Advent of Code in pure SQL: https://gitlab.com/mauricioszabo/advent-of-code-2021/-/tree/master/src :rolling_on_the_floor_laughing:
The last day I dared it's basically an adapted version of the "A* Pathfinding" algorithm, but I never made it so it performed well to solve the second part of the challenge...
I think it is a really great way to learn. E.g., create a sudoku solver in Clojure, then try it in SQL.
Also I remember something I learned quite early - somebody was explaining SQL and he said: "SQL Hates Loops! Transform everything into tables and join, filter them, but don't do loops!" Another thing is to learn how to use EXPLAIN - might save a lot of time debugging things