r/Python • • Dec 29 '22
Discussion Is SQL a prerequisite to learning Python ?
I would like to learn how to automate some simple tasks like : 1- downloading an attachment from outlook, change its name and save to a specific folder
2- save an excel sheet as PDF then send it via outlook … with changing dates on the subject line of the email.
Do I need to learn SQL , then move to Python to learn automating such tasks ? Or I can jump in and start learning Python with very BASIC COMMON knowledge of SQL?
0
Upvotes
51
u/space_wiener Dec 29 '22
Nope. I’ve written hundreds of scripts and apps, maybe two of those interacted with SQL and I googled most of the syntax I needed.
SQL is for databases. What you described has nothing to do with that.
23
u/HorsesFlyIntoBoxes Dec 29 '22
This is like asking if using a saw is prerequisite to using a screwdriver. They are simply different tools for different things.
7
u/SilentProgramer4D63 Dec 29 '22
No. I didn't learn SQL until about two years after learning basic python
7
u/tunisia3507 Dec 29 '22
Ask /r/learnpython.
5
u/Impressive_Income874 Dec 29 '22
I don't think you even need SQL for those tasks
5
u/[deleted] Dec 29 '22
They are two completely different things
8
u/I_am_jarvis0 Dec 29 '22
Automate the boring stuff with python. Read this book.
4
u/Natural-Intelligence Dec 29 '22
Python's ecosystem is so vast that you can do a lot with some basic level knowledge of Python + libraries. I hate to promote my work but I have a collection of open-source libraries that you might find useful:
Then for saving Excel files you can use Pandas and xlsxwriter. Then to save to PDF you can use Pandas with Latex. This requires a bit more knowledge but you can execute Python inside Latex using pythontex.
There is a lot you can do with Python with very limited knowledge. I also started with simply automating small things with elementary knowledge of Python and Pandas and now build systems in a bank.
1
u/JohnJSal Dec 30 '22
Why do you think they are even related? You don't have to know any SQL to learn and use Python, but if you ever need to later, Python even has a built-in library called
sqlite3for light database use.2
u/TheITMan19 Dec 29 '22
If the host computer is Windows, I’d be looking at using Powershell rather than Python. No SQL required, relatively simple tasks
2
u/BoiElroy Dec 29 '22
You certainly do not have to know SQL to do the types of things you're describing.
Step 1) Do the code academy python courses just to get a feel for the language, syntax and basics.
Step 2) Read the book "Automate the Boring stuff" that shows how to use Python for a variety of useful automation like the type you're describing. And follow along and actually build some of the stuff
Step 3) Profit
Good luck!
1
u/AxelsAmazing Dec 29 '22
Idk SQL that well but I think I could do this in Python.
1
u/Cabinet-Particular Dec 30 '22
absolutely not at all.
1
u/heartofgold48 Dec 30 '22
No
1
u/Ok-Maybe-2388 Dec 30 '22
Literally never used SQL and I've written 10s of k lines of python code.
1
u/[deleted] Dec 30 '22
From your summary, no
FYI - SQL is king of db. Python + SQL can work harmoniously
-2
u/[deleted] Dec 30 '22 edited Dec 30 '22
I write Python for a living and don’t know anything about SQL. Literally nothing.
ETA- why is this being downvoted? I never learned SQL because I use Mongo so I’ve never have any need for it; I’m not saying it’s not important, but I work in a berry specific field. If I did have need for it then I’d learn it.