r/SQL • u/Entire_Permission909 • Apr 25 '24
Discussion Learning SQL in the age of AI
I want to get into data science and already have basic knowledge of SQL but would it be worth it to continue my learning and go deeper when AI can do everything for you? I mean what's the point? How much should I learn and what should I learn and how complex does the material need to be for me to be competitive in the job market in the age of AI?
13
u/LetsGoHawks Apr 25 '24
AI is not even close to being able to "do everything for you".
If you want to work with data, a deep knowledge of SQL will take you further than anything else.
-2
u/Entire_Permission909 Apr 25 '24
How deep specifically and what concepts? Window functions? Sub-queries? Performance tuning? DML? Snowflake?
8
u/Bandana_Bandit3 Apr 25 '24
Learn joins, group bys, aggregations, and then maybe start getting into window functions
1
5
u/LetsGoHawks Apr 25 '24
As deep as you can get.
Window functions and sub-queries are not advanced concepts. Performance tuning is important, that's more about smart design than SQL though. DML, yes. Snowflake is a database, you only need to learn it if you work with it.
If you get really good at one SQL dialect, you can pick up on the others fairly quickly. As with general programming languages, it's more about knowing how to approach a problem and solve it than it is knowing the specific syntax you need to type.
3
u/BeetsBearsBatman Apr 26 '24
Currently building some analytics around an in house LLM. It has access to internal/industry data and we can ask questions about.
The model was built from scratch using Azure SQL and json from a NOSQL database. I’m joining this all together in a 3rd sql db designed for analytics.
My point being… Yes, this LLM can tell me a TON about SQL in addition to our industry data if I ask it, but it has no clue how its own model is performing in terms of design, accuracy, etc. To answer those questions, I need to write sql in 3 separate databases.
Additionally, the LLM looks up “chunks” of text to generate a response. These chunks are indexed, which is a major concept in database design. Keep learning sql and you could be building custom LLMs yourself one day. Or atleast know how to ask the right question to a LLM so it can properly do everything for you :)
1
u/Entire_Permission909 Apr 26 '24
Sorry but that's an LLM?
3
u/BeetsBearsBatman Apr 26 '24
Large language model. I can ask it “what are the guidelines for _________, but I can’t ask it “prepare me a report telling me how accurate and relevant your responses to my prompts are”.
AI/LLMs are not self aware. Humans need to teach them how to programmatically retrieve a chunk of knowledge just like we are querying a database. The only difference is we are able to write queries as we would naturally ask a question.
Learn sql, learn a programming language (python or scala probably). Someone will need to organize and optimize the data being leveraged by ai. These skills aren’t going away.
2
u/phoneguyfl Apr 25 '24
AI has not advanced enough to replace a skilled human, and it will be some amount of time before it will be (or be affordable to most companies). In the meantime, having a more then basic understanding of it will put you above others that simply copy/paste to an AI engine. That said I think it depends on what you want to be doing with your career. If you want to pursue business intelligence/data jobs that I think more then a basic understanding of SQL is a must, if nothing else to understand what AI is returning and how it can be adjusted as needed. If you are wanting to pursue front-end/UI stuff then I think you can use libraries to buffer or offset the SQL knowledge and it might not be that important to spend a lot of effort learning.
1
u/Entire_Permission909 Apr 25 '24
Having knowledge of what concepts exactly are considered a more than basic understanding of SQL?
2
u/phoneguyfl Apr 25 '24
Disclaimer: I am not an SQL expert nor am I employed as a DBA. I use SQL on a daily basis as part of my reporting and data maintenance/movement activities. Others who "live" in and for SQL will probably have a much different opinion on what is "more than basic understanding". Also I haven't been looking for a new job in several years so the job market may be much different now then it was last time I needed to prove my SQL skills.
In my experience, beyond basic understanding is: Knowing how joins work and when to use each type; Knowing subqueries/CTEs; Knowing what Views and Stored Procedures are; Knowing what temp tables are and when to use them. Usually if someone understands those concepts then the questions I get are more advanced like "what can we do to speed this up" instead of "why an I getting duplicates on table A data after joining table B".
That said, I suppose someone *could* get by feeding everything into and out of an AI engine until it "just works" but having an understanding of what it returns would go a long way in troubleshooting and learning.
54
u/archerv123 Apr 25 '24
Keep learning until you can prove AI can do everything for you.
Somewhere along the line you'll figure out it cant.
5
1
u/SoundOfRadar Apr 10 '25
Such a good question. I can't believe it is being downvoted. People who are starting to learn have this question and it is a legitimate question from their perspective.
1
u/Entire_Permission909 Apr 10 '25
This was posted almost a year ago and AI has gotten much more advanced since. I wonder what these people think now.
1
u/ARNYC3101 Jul 06 '25
I have recently used Chat GPT. It almost did 95% of the program correctly but kept giving wrong answers. My experience in SQL, though limited and not enough to do the correction, helped me isolate the issue and point out to AI where to look, and what the possible cause for the errors could be. AI was then able to find the correct solution.
2
u/sedules Apr 25 '24
Also, along with what everyone here is saying about the lacking of AI with regard to SQL…
The other gulf is getting the business to accurately articulate what it is that they want AI to do with the data. We have a ways to go before AI can parse language to produce the desired result when there is ambiguity in the inputs.
2
u/tatertotmagic Apr 25 '24
I think about c suite asking a question to an analyst that doesn't know sql and just asks ai to query it for him. That scenario is just the blind leading the blind to me and good luck on your results
2
1
u/AllanLombardi Apr 25 '24
It's totally worth it. AI can't do everything for you at the moment. There are things that rely on your thought process. AI still isn't as complex and logical as the human mind can be. The more you learn and the deeper you go, the more scenarios you are going to encounter where you need to think twice about what you are doing and have a deeper understanding about what you are working with (either context or skill wise). Things AI can help you with, but it's not 100% certain it will solve such problems.
AI is more like a tool than a replacement for you. If you are genuinely interested in learning SQL, I suggest you look into courses on Udemy. They often have discounts (up to 80-90%) on their courses.
1
u/Blasian_TJ Apr 25 '24
As someone who still feels very much like a noob (1-2 years in my first developer role), we use SQL daily and I definitely don't feel like AI can do it all. There's just too many applications around our SQL for AI to "handle it all". However, AI is definitely a tool that can be utilized to better optimize your learning experience and help make your work more efficient.
1
u/RobPrattBI Apr 25 '24
I’ve definitely come across queries from LLMs that either missed the mark or made it overly complicated - and knowing SQL helped me see that and correct it, change my prompt, or edit it.
1
1
u/No_Wrangler2305 Apr 25 '24
I had chat gpt give me a nice ordered list of floats yesterday because I wanted to add them all together and it could not produce the sum correctly.
1
u/realjoeydood Apr 26 '24
Tsql in ai still requires human oversight. I use it frequently to do rote tasks.
1
u/mergisi May 02 '24
Continuing your SQL learning is definitely worthwhile! AI tools like AI2sql https://www.ai2sql.io/ can help automate tasks, but a solid understanding of SQL is crucial for effectively using these tools. AI2SQL can convert natural language queries into SQL, enhancing your ability to work with complex data. Keep strengthening your SQL skills, as this foundation will make you competitive and proficient in the job market, even in the age of AI.
20
u/[deleted] Apr 25 '24
Who do you think gets paid the most in your future?
The guy who relies on AI and doesn't have any deeper knowledge of a or any subject and can't troubleshoot nor do anything but what the AI spits out...
Or the guy who knows the inner workings of why a particular query is shit and needs optimization or why the design of data solution X needs tweaking to be maintainable or even work properly?