Hi everyone! It's my first #tsql2sday. Here is my post and have a great day!
jamalhansen.com/blog/tsql-tu...
Hi everyone! It's my first #tsql2sday. Here is my post and have a great day!
jamalhansen.com/blog/tsql-tu...
Don't pull rows into Python to count them.
Counter(c['city'] for c in customers) works, but sends every record over the network.
SQL's GROUP BY does it on the server:
SELECT city, COUNT(*) FROM customers GROUP BY city
Five groups = five rows.
Read more:
jamalhansen.com/blog/group-b...
SQL's WHERE filters rows before they leave the database
Python: [c for c in customers if c['is_premium']]
SQL: SELECT * FROM customers WHERE is_premium = true
Same, but SQL filters on the server.
jamalhansen.com/blog/where-f...
Run a SQL query twice. Get different row orders. Not a bug.
Databases optimize execution differently each time. If order matters, you have to be explicit with ORDER BY
SQL's advantage over Python here: mixed sort directions in one line. ORDER BY date DESC, name ASC
jamalhansen.com/blog/order-b...
I write a weekly blog series called SQL for Python Developers, publishing weekly.
The idea is simple: if you already think in Python, SQL doesn't have to feel foreign.
If you write, teach, or build in this space, say hi!
jamalhansen.com
New here (well, new-ish). I'm Jamal. Data scientist, blogger, dad of 5, MBA student. Currently on paternity leave, which means I have one hand on a baby and the other on a keyboard at all times.
Looking to connect with folks in the data/Python/SQL space.
SELECT * returns everything. You probably only need two columns.
But SELECT does more than pick columns. It renames with AS, computes expressions, and transforms text. It maps directly to Python list comprehensions.
DISTINCT can mask problems in your query. Why?
jamalhansen.com/blog/select-...
So far, I've covered some basic topics to get started, and now we are getting down to business.
Coming up, we have lots of great topics including: GROUP BY, NULLs, JOINs, subqueries, CTEs, window functions, and more.
New posts every Monday at jamalhansen.com/series/sql-for-python-developers/
SQL can be difficult to learn because it doesn't work like Python.
You don't give it steps. You describe the dataset you want, and SQL figures out how to return it.
Once that clicked for me, SQL became elegant.
This series is built around making SQL elegant so that it clicks for you.
I'm writing a free weekly series: SQL for Python Developers. 25 posts, 6 published so far.
Every concept gets a Python comparison. Every post uses DuckDB so you can follow along with just pip install.
If you write Python and avoid SQL, this is for you. ๐งต
Iโve scheduled my AWS Certified Data Engineer โ Associate (DEA-C01) exam for May 9. Wish me luck!
- Udemy Training - www.udemy.com/course/aws-c...
- 50% Discount - pages.awscloud.com/GLOBAL-other...
- Certification - aws.amazon.com/certificatio...
#AwsCertified #DataEngineer
Bat! ๐ฆ
Awesome! Glad to hear that I made a good choice. There are so many options out there.
Today I decided to learn Go. Just starting out and discovered that the compiler comes with dependency manager, test runner, formatter, etc.
Ok, Iโm curious to know more!
#golang
So happy to have the opportunity to attend my first All Things Open conference this year #AllThingsOpen.