Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm curious about how this performs with more complex queries, like joins across five tables.

Also, does the training phase actually involve writing SELECT queries by hand?

In the age of ORMs and so on, many people have probably forgotten how to write raw SQL queries.



> In the age of ORMs and so on, many people have probably forgotten how to write raw SQL queries.

I’ve heard this general sentiment repeated quite a lot - mostly by people that don’t use ORMs. In my experience pretty quickly you reach the limits of even the best ORMs and need to write some queries by hand. And these tend to be the relatively complicated queries. You need to know about all of the different join types, coalescing, having clauses, multiple joins to the same table with where filters, etc.

Not that this makes you a SQL expert but you can’t get too far if you don’t know SQL.


ORM abuse are absolutely rife in small-scale/volume build industries i.e. web agencies, outsourced crews

8/10 projects I look into don't have any indexes set up.

Use of ORMs with little thought into lazily loaded relations lead to 100s of queries being done per request.

It's pretty mad. Do not underestimate the propensity of a developer to stick to the only tool they know how to use. Unfortunately ORMs like Eloquent make it way too easy.


> small-scale/volume build industries i.e. web agencies, outsourced crews

Well that could explain it. I’ve only worked in companies where everyone working on the app codes with the expectation that they could be dealing with their mistakes for years.


Author of the package here. Joining 5 tables is not a problem.

The training does not necessarily require you to write the queries by hand. A trick that we've seen people do is to just train with DDL statements and then ask "leading" questions if it can't answer on the first try.

I've been using the package myself for about 6 months and while I haven't forgotten SQL, what I have forgotten are the fully qualified table names and which tables live in which schemas etc since I never have to think about that.


From my experience, GPT-4 will do just as well with joins as without. And that needs no specific, separate SQL training (which I assume tens of thousands of examples are already in).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: