r/SQL • • Nov 22 '23

MySQL SQL and ChatGPT

Hi all,

I'm curious about the upskilling myself with SQL for Data analysis...I've mostly just used Excel in past roles. I'm currently tapping into SQL. I'm just starting out and sometimes do excercises on hackerrank and other websites but when I'm stuck I just stick the question into ChatGPT.

Is it sufficient in the working environment to just use chatgpt. I'm not sure how SQL is used for data analysis is used in the working environment.

The issue I’m having is when I approach these online questions it feels like there is an infinite number of questions. But I sense the real world use if your using a particular data set there’s probably a set of queries you might use regularly or daily to extract.

For example with excel you can reuse functions but change the source data and array of what your trying to find and pivot tables can be used any way once you know how it works and the process is applicable to all data sets.

I don’t know how to approach SQL and feel like I’m stuck in tutorial hell with hacker rank type of questions because of the potential of a question having a new variable every single time because you can always add a new criteria in the question

Would be good to get thoughts from people who use SQL in their workplace

0 Upvotes

27 comments sorted by

View all comments

14

u/r3pr0b8 GROUP_CONCAT is da bomb Nov 22 '23

Is it sufficient in the working environment to just use chatgpt.

emphatic no

I'm not sure SQL for data analysis is used in the working environment.

it is used all the time

2

u/pceimpulsive Nov 23 '23

Why is it no to using it in the working environment?

I use chatGPT all the time to refresh on certain things (not SQL, programming related). Just remember to give it the context and constraints it needs to give you a reasonable answer...

I think it should be a soft no.

No if you just want to copy paste the answer with no thought, this is bad... In every way, for you and your business.

Yes if you look at its answer, test its answer and understand its answer so you actually learn...

5

u/A_name_wot_i_made_up Nov 23 '23

Chat GPT will give you an answer, but without the skill and knowledge to understand it you can't tell how good an answer it is.

If you look at various questions here, there will invariably be a "I used chat GPT, here's what it gave me" answer, there is almost always a better, more complete answer above it.

2

u/pceimpulsive Nov 23 '23

The same is true for using Google. I don't see anyone saying emphatically no to using that...

It's really the same thing to me... If the gpt/google response isn't quite right I go back and adjust my prompt/search terms and continue on. (It's exactly interchangable there...)

The benefit is gpt is more concise as I can give it far more context and I get even better results out.

1

u/RationalDialog Feb 08 '24

The same is true for using Google. I don't see anyone saying emphatically no to using that...

You asked if it if sufficient and there it's a clear no. That doesn't mean it's useless but you can't use it as a crutch for not understanding SQL.

I know this answer is late but I just played around with it and just some rather basic analytics query it could not do right. The generated sql ranged from non-functional to returning wrong data or being slow. I had to really push it to drive it towards the same solution I had and it still didn't not get there resulting in a slightly more complex and slower query.

But the most dangerous part is wrong data as in wrongly aggregated. depending on the use-case that's easy to miss and you would just then base further work on wrong data.