3 ms·
SQL queries don't start with SELECT (2019)
- dangoodmanUT 2y agoDuckDB sql let's you do from first (thank god) from first is correct, and way more ergonomic
- jbn 2y agoindeed https://en.wikipedia.org/wiki/Language_Integrated_Query https://en.wikipedia.org/wiki/Language_Integrated_Query got this right, as in fact you do need to see the from clause first for the IDE to be able to suggest what to put in the from clause...
- croes 2y agoNowadays with IDEs with auto complete. When SQL was developed it was easier if a query reflects natural language.
- baq 2y agoUnsolicited career advice for juniors: read a SQL book over a weekend and read a book about the DBMS your job is using on the next weekend. You’ll be very surprised by how much senior folks don’t know or worse about databases.
- niwtsol 2y agoThis is fantastic advice. At the first startup I worked at, we had several issues with our MySQL dbs & ETL jobs (MyISAM table locks, slow updates, no replication) - I spent a few days just reading the relevant sections of "High Performance MySQL: Optimization, Backups, Replication, and More" - and voila I had solid recommendations built on facts rather than random opinions people created over the years - put my career on an entirely different trajectory.
- baq 2y agoExactly what I had in mind, I've seen this first hand a couple times. It's a few days of reading which literally can change your life.
- dondraper36 2y agoIdeally, also invest some time and work through the CMU Intro to Database Systems course by Andy Pavlo. That's how I would have started if I had to start from scratch
- jxjnskkzxxhx 2y agoFurther advice about life: read, ask questions, dig deeper. You'll be very surprised how many people don't know the basics of anything.
- dang 2y agoDiscussed at the time: SQL queries don't start with SELECT - https://news.ycombinator.com/item?id=21150606 https://news.ycombinator.com/item?id=21150606 - Oct 2019 (253 comments)
- KronisLV 2y agoMakes me think of PRQL: https://prql-lang.org/ https://prql-lang.org/ I always found the idea of written SQL making you specify what you want to select before you know what you're selecting from odd.
- jeisc 2y agoa great resource for mysql: https://web.archive.org/web/20130218113554/http://www.artfulsoftware.com/infotree/queries.php https://web.archive.org/web/20130218113554/http://www.artful...
- croes 2y agoWouldn't it be impossible to start with SELECT before the FROM and JOIN?