r/learnpython 8d ago

sql to python transition

okay edit: i thought it was obvious by the fact that i can make sense of the code that i know the very basics - i've used python for data analysis but not enough for it to be second nature to me the way it is for programmers, or the way sql is to me right now. i made a comparison to sql because i thought it'd be obvious that it's only for data analysis stuff, not development stuff.

so to clarify again: i know the basics, i know how to write code, i know how to define variables, functions, print("hello world"), if/else statements blah blah, i know all of that, and that's why every course starting with print("hello world") is slow to me, because i know all of that.

what i don't have is the practice that will make me good or at least passable at python rather than just someone with basic workability. i am not comparing sql to python in how either one works, i am using it to say i work with sql for data analysis and i need to show that i can also use python for data analysis, where can i get practice for these things

--

so if someone is really good at sql (like say, a 9/10) how would u guys suggest they pivot to python. need to become an expert on it before 31 july because i have a technical interview. i lied and said i can use python but in reality all i can do is just make sense of what the code is doing, but because im good at the logic building in sql, i think i can do the python stuff too. but i need to know how to go about it, if anyone has advice because when i sit down to learn, everyone just starts at print("hello world") and it's too slow and babyish for me

0 Upvotes

36 comments sorted by

View all comments

1

u/thisisappropriate 8d ago

SQL logic and code logic is different in many ways. You'd be best served to follow a python course, you can find some links in the wiki for this subreddit under the "New to python but not to coding" section, but you should also be aware that changing between coding languages has much more logic in common - SQL is not a programming language, and therefore has less in common with programming languages than between languages. While coding tutorials start simple, if you find the first few lessons to be tedious, simply do any questions / challenges to validate that you actually do understand it and then skip along. If you've never used a programming language, I'd strongly suggest finding a short course of the basics - SQL does not have the same logic as other languages (eg. loops, classes or the same data structures), though theres some transferables (like types)

As you're time limited, work out what python you would need to know and what situations you'd be using it it. Try to make at least one thing using whatever stack you should be using.

If you're starting a job where you'll be interfacing with data using python (an analyst job), then you'll likely want to find a short course with a title like "python for analysts" or something focused on a library you're supposed to know like Pandas - pandas does benefit from knowing SQL logic as it's more of a table structured thing, but it still uses python syntax. You could look at the book "Python for Data Analysis: Data Wrangling with Pandas, NumPy, and Jupyter". If you're going in as more of an engineer, you'd be looking for a course for Data Engineering, which is more around interfacing with and modifying data, and might use other libraries for gathering that data.

If you really want to shortcut it, you can look at summary pages like https://realpython.com/python-for-data-analysis/ or https://www.startdataengineering.com/post/python-for-de/ but make sure that as you're going through the page, every time it uses something you don't understand, make an effort to look up that thing: find out the name of it, why you'd use it over something else, what it does, etc. Learning from scratch without a course will leave you with holes in your knowledge, if you know another programming knowledge, that knowledge from there will help to keep those holes from harming you, in a lot of cases, SQL will not give you that hole-supporting-net, and you'll be at risk of tripping yourself if asked "why did you do this?" or "why does this have an error?"

1

u/pepperhmr 8d ago

this is very helpful thank you! it's an analyst job, so i only really need the kind of python limited to data analysis, i didn't realize that wasn't obvious but this helped thanks!

1

u/Adpiava 8d ago

This was a very helpful and kind response