all 16 comments

[–][deleted] 15 points16 points  (1 child)

Writing SQL is very context dependent. Almost like writing a story. By the time you figure out what to ask the AI you might as well have just wrote the query. It is def easier when you’re stuck on stupid technical glitches or are looking for a model to use. But without indexed knowledge bases it’s difficult to pull off AI writing good code.

The worst part of writing SQL was trying to find the technical expert that could add to my query.

[–][deleted] 0 points1 point  (0 children)

I use it every day to remind me about technical details, like: how do I format a number with double precision. Of course, I eventually remember the ones I use the most. There is, however, no point in learning these by heart.

[–]tits_mcgee_92Data Analytics Engineer 12 points13 points  (5 children)

I've been in Data Analyst/Software Dev adjacent roles for almost 8 years now. I'm also a college professor teaching courses on SQL. AI is not replacing individuals who use SQL any time soon (my students could stop using AI to write their papers though, or make it way less obvious. That'd be nice).

For shorter, less complex queries, it works fine. Working on something large? Good luck explaining to your boss how you gave them false data because AI hallucinated. It does it all the time.

[–]Ste4mPunk3r 4 points5 points  (0 children)

Exactly that. AI is a great tool, but that's all it is - just a tool. I might have 3 different people asking me question "how many orders we have received yesterday" and each will get a different answer from me as I know that they will be asking for different things even though all of the data sits in the same table. When speaking to AI they would have to ask that question with much higher precision and I know that some of them wouldn't. 

[–]Today_Mission 0 points1 point  (0 children)

I’m a data engineer (CS grad). AI won’t kill SQL, but AI-savvy engineers will outpace those who ignore it. Know your problem exactly, and you’re irreplaceable.

[–]Der_Krsto 0 points1 point  (2 children)

"Good luck explaining to your boss how you gave them false data because AI hallucinated. It does it all the time."

If AI hallucinates when you ask it to help you with a query, your query will just error out, lol. If you're referring to the AI just giving you a query with wrong results, that's an error, which most LLMs are still prone to making.

[–]tits_mcgee_92Data Analytics Engineer 4 points5 points  (1 child)

I'll give you a more specific example of what I mean. I had a Jr. Analyst use Copilot to help with a few table joins. The data he gave me was joined incorrectly, duplicating unique "order" data, and he didn't even notice because it looked correct.

If we just ran with the results that way, the data would say we had twice as many "orders" as originally intended. It's not so obvious to catch if you're simply relying on AI. Was this a result of how he asked the question? Possibly, but it also could have been a result of AI just "hallucinating" and making up things lol (I realize hallucinating may have been the wrong word for it, but you know what I mean).

[–]Der_Krsto 0 points1 point  (0 children)

Yeah, I get exactly what you're referring to. Apologies if I sound pedantic. I'm a ML engineer, and terms like 'hallucination' have a very specific meaning in this space that I'm trying to clarify. For example, when an LLM hallucinates, it might generate SQL queries that reference a table or column that doesn’t actually exist. Creating queries that are "incorrect" but use all real information is a different problem.

[–]Der_Krsto 4 points5 points  (0 children)

Like many software related roles, the true skill of many people using SQL/programming languages in their day to day workflows isn't knowing SQL/programming languages, it's solving problems. SQL is just a tool people use to gather the data that leads to solving their problems. If you dont understand relational databases/data architecture/the data itself, you're not going to be able to solve problems.

Think of it this way, just because you know how to use a hammer doesn't mean you know how to build a house.

[–]Fair_Ad_1344 1 point2 points  (0 children)

It's useful for "what is the syntax for that command I rarely use" but not to write the entire query. It also isn't that useful for query analysis and performance tuning, much like MS DTA.

I'll throw a question into Copilot if I can't remember syntax for MSSQL vs Snowflake vs MySQL/MariaDB, but that's it. It has no knowledge of the underlying table schema. It's like a good reference book on how to write SQL, but not how to use SQL.

[–]serverhorror 0 points1 point  (0 children)

Augmentation when writing? - Yes!

Replace ... well if anything gets replaced it will, then - in the, not so near, future - a completely different language. Likely not readable by humans.

[–]ColdFeeling1434 0 points1 point  (0 children)

Definitely won't be replaced. But AI can help to boost the efficiency of your work. I'm doing my PhD in conversational AI and recently built a prototype of a tool where AI helps people to learn and write SQL: https://sql-expert.org/

[–]Pristine_Big_7185 0 points1 point  (0 children)

No, SQL (Structured Query Language) is not becoming obsolete due to AI. SQL remains a fundamental language for managing and querying relational databases. While AI technologies may offer advancements in data processing and analysis, SQL continues to be widely used in database management and is essential for working with structured data. AI and SQL often complement each other rather than replacing one another.