Live data from Hacker News

Show HN: Natural-SQL-7B, a strong text-to-SQL model

github.com

51–60 of 171 posts

Re: Show HN: Natural-SQL-7B, a strong text-to-SQL model

#51

Earlier quoted context omitted.

What makes you think that SQL doesn't have "for loops"? Ever heard of LATERAL joins/CROSS APPLY? SELECT loop.value, x.squared FROM generate_series(1,5) AS loop(value) CROSS JOIN LATERAL (SELECT loop.value * loop.value AS squared) AS x;

TIL

They're incredibly useful -- any time that you want to both:

- Reference data from the previous part of the query (the "left-hand side")

- Return multiple columns

The only way you can achieve it is with LATERAL/CROSS APPLY.

Regular correlated subqueries can only return a single column, so something like this doesn't work:

  SELECT
    loop.val, (SELECT loop.val * loop.val, 'second column') AS squared
  FROM
    (SELECT loop.val FROM generate_series(1,5) AS loop(val)) as loop
You'd get:

   error: subquery must return only one column

Re: Show HN: Natural-SQL-7B, a strong text-to-SQL model

#52

Earlier quoted context omitted.

1. If you are a a programmer I think you should learn SQL. It will give you a different perspective on programming that I think is invaluable. (I.e. programming without for loops) 2. Combining and slicing data is a craft, and doing it subtly wrong in one step can lead to fatal errors in the outcome. And most importantly, it can be very difficult to notice. Numbers don't smell. That is why I would be very hesitant to…

What makes you think that SQL doesn't have "for loops"? Ever heard of LATERAL joins/CROSS APPLY? SELECT loop.value, x.squared FROM generate_series(1,5) AS loop(value) CROSS JOIN LATERAL (SELECT loop.value * loop.value AS squared) AS x;

This is not what I call a for loop but more akin to a list comprehension.

And this is the point I was trying to make.

Instead of start with the "how", learn to do the "what".

Re: Show HN: Natural-SQL-7B, a strong text-to-SQL model

#53
In the data world I've worked with tons of folks whose responsibilities include getting questions from execs, knowing their way around the data warehouse enough to write SQL to answer those questions, and delivering the answers back (sometimes formatted nicely). Sometimes they have to predict what followup questions the exec will ask, like "why is that number so low, it obviously shouldn't be that low" so they can press the data engineers for bugs.

Like all things LLM, I don't know if this is about to make those responsibilities a lot easier, or just eliminate them altogether.

Re: Show HN: Natural-SQL-7B, a strong text-to-SQL model

#54

Earlier quoted context omitted.

Hm. I disagree that executive level shenanigans translate to real world non-compliance with privacy law when there is an explicit request to delete/not store data.

> I disagree that executive level shenanigans translate to real world non-compliance with ________ law Uber Airbnb Facebook The entire financial industry also, every huge corporation that paid a vast (but relative to their market cap, insignificant) settlement, long after incidents in question, without admitting guilt. Corporations have essentially culled vast numbers of humans until forced to stop. What’s a little l…

None of these cases involve unambiguously claiming that you will delete data and then not doing it.

Closer would be FTX which unambiguously claimed one thing and did the opposite, but I do not think OAI has FTX level of dysfunction.

Re: Show HN: Natural-SQL-7B, a strong text-to-SQL model

#55
post #21

So it looks like it scores 76.5% on SQL-Eval [0], a bit behind GPT-4 at 83% and sqlcoder-15b at 78%. What kind of applications would this be useful for? What can you build with an AI data science intern that's right 75% of the time? As a programmer who always has to look stuff up when I SQL, I could definitely see asking something like this for a first draft of a query but it seems like I'm slightly better off asking…

As an end consumer, you should be well versed in SQL (or whatever subject) yourself and should proof read twice all the queries generated before you make a decision based on the data that's pulled from the generated queries.

That's the story of the LLMs in general.

The hype is free. Startup ecosystem are a bonus.

Re: Show HN: Natural-SQL-7B, a strong text-to-SQL model

#57

Earlier quoted context omitted.

1) OpenAI has consistently gone back on commitments it has made 2) Sam Altman has a shady track record publicly, and if you believe the things people say privately he has consistently done business very dishonestly throughout his career. He is the CEO, and virtually the entire executive team are people he brought in from his network. It’s his company. 3) To give one example of many, OpenAI recently changed the terms…

If you don't trust OpenAI, you can choose to trust Microsoft. Azure OpenAI is 3-months behind OpenAI that costs 3x as much, but you get more 'security' and better performance.

Yes and I recommend that people interested in GPT-4 use this service as it’s isolated from OpenAI and it is the absolute best model right now.

That said, there are 3 quite worrying future possibilities, both stemming from the level of investment and commitment by Microsoft in OpenAI - a huge percentage of Azure’s value is bet on an exclusive partnership with them. That gives OpenAI a lot of leverage. And customer data is a very tempting cookie jar to build a long term moat for these companies

Possibility 1: someone overtakes OpenAI models and you’re stuck on Azure who won’t offer that model

Possibility 2: OpenAI decides to break with Microsoft and you’re stuck with a useless application. AWS Bedrock is far less likely to leave an AI application obsolete.

Possibility 3: OpenAI put pressure on Microsoft to loosen the data protections around the service, or go around them entirely. This is a particular concern as the systems in the service become more complex and agentic and more difficult for Microsoft to audit. Model weights are highly opaque and Microsoft cannot trace the exact possible behaviour of these systems. What if GPT-6 changes its own weights during inference for example? How can Microsoft ever understand if that’s a true critical piece of functionality or a proxy method to access customer data etc.

Re: Show HN: Natural-SQL-7B, a strong text-to-SQL model

#58

Earlier quoted context omitted.

TIL

They're incredibly useful -- any time that you want to both: - Reference data from the previous part of the query (the "left-hand side") - Return multiple columns The only way you can achieve it is with LATERAL/CROSS APPLY. Regular correlated subqueries can only return a single column, so something like this doesn't work: SELECT loop.val, (SELECT loop.val * loop.val, 'second column') AS squared FROM (SELECT loop.val…

I love LATERALs, but this still fits within set theory and a bulk application rather than an iterative for-loop. It may even be implemented as a for-loop within the engine, but SQL being declarative abstracts that away from the query interface.

It's sets all the way down. A set of f(x) is still a set.

Re: Show HN: Natural-SQL-7B, a strong text-to-SQL model

#59

Earlier quoted context omitted.

TIL

They're incredibly useful -- any time that you want to both: - Reference data from the previous part of the query (the "left-hand side") - Return multiple columns The only way you can achieve it is with LATERAL/CROSS APPLY. Regular correlated subqueries can only return a single column, so something like this doesn't work: SELECT loop.val, (SELECT loop.val * loop.val, 'second column') AS squared FROM (SELECT loop.val…

If anyone is interested, I had gpt explain this SQL to me - and it was really helpful, as I couldnt parse that with my level of SQL...

https://chat.openai.com/share/931b1778-6393-4e86-94b4-b3b5a5...

Re: Show HN: Natural-SQL-7B, a strong text-to-SQL model

#60

Earlier quoted context omitted.

If you don't trust OpenAI, you can choose to trust Microsoft. Azure OpenAI is 3-months behind OpenAI that costs 3x as much, but you get more 'security' and better performance.

> Azure OpenAI is 3-months behind OpenAI… How is it 3 months behind if you get access to current OpenAI models?

You don't.

It took like 2 extra months for Azure OpenAI to get GPT-4 turbo. There's a noticeable time delay between OpenAI deploying their latest model and when Microsoft manages to shove it in Azure.

Post reply on HN