Posted 1 week ago
36.77K followers
627 views
25 likes
1 comments
0 shares
The same task. Three different tools. One cheatsheet. In a typical week I use all three. Excel for quick sense checks and stakeholder files. SQL to pull and explore data. Python when I need to automate or go deeper. The tool depends on the job. This cheatsheet covers 6 tasks every analyst does regularly, solved three ways. Same reference dataset throughot so you can see exactly what each approach returns. Filter rows — Excel filter, Python boolean indexing, SQL WHERE clause. All return the same two rows. The syntax is different. The thinking is identical. Sort data — Excel sort dialog, Python sort_values, SQL ORDER BY. One click vs one line vs one clause. Group and aggregate — Excel pivot table, Python groupby, SQL GROUP BY. This is where the tools start to feel meaningfully different. Pivot tables are faster to build. Python and SQL scale better. Handle missing values — Excel Go To Special, Python fillna, SQL COALESCE. All fix the same problem. SQL and Python do it inside the query or script without touching the source data. Create a calculated column — Excel formula in a new column, Python assignment, SQL SELECT with arithmetic. Excel is the most visible. Python and SQL are the most repeatable. Join two tables — Excel XLOOKUP or Power Query, Python merge, SQL LEFT JOIN. This is where Excel starts to struggle at scale. SQL and Python handle millions of rows without breaking a sweat.