
Pivot Tables Versus GROUP BY and CASE in SQL Compared
Rebuild an Excel pivot table in SQL with GROUP BY, conditional aggregation, ROLLUP and window percentages, and see what changes when columns are fixed.
Everything you need to level up your coding skills.

Rebuild an Excel pivot table in SQL with GROUP BY, conditional aggregation, ROLLUP and window percentages, and see what changes when columns are fixed.

Translate IF, nested IF, IFS and SWITCH into SQL CASE WHEN, with AND and OR, NULL handling, branch types and what each returns when nothing matches.

Translate COUNTIF, COUNTIFS, COUNTA and COUNTBLANK into SQL with count star, count of a column and FILTER, and handle distinct counts and blanks correctly.

Translate SUMIF and SUMIFS into SQL with WHERE, GROUP BY and FILTER, including criteria, wildcards, dates, OR conditions and the blank and case traps.

Write an XML file into an xlsx workbook with openpyxl so numbers are numbers, booleans are booleans and identifiers stay text, and read it back to check.

Translate VLOOKUP and XLOOKUP into SQL joins: exact and approximate match, first-match behavior, not-found values, duplicates and which side to keep.

Translate Excel formulas into SQL: lookups, conditional sums, IF, text and date functions, running totals and pivots, with a worked dataset and the traps.

A working guide to openpyxl: the workbook model, reading values and formulas, writing and editing files, large-file modes, styles, charts and errors.

One XML file converted to JSON, CSV, YAML and Excel with one parse and four writers, what each target loses, and how to prove nothing went missing.

An exported date shows as 45292 because Excel stores dates as numbers and the cell has no date format. See the cause, the code fix and a file repair.

Stop repair prompts, garbled accents and wrong columns when exports open in Excel: legal characters, sheet names, time zones, NaN, BOM and separators.

Build a job that queries a database, writes an Excel file and emails it on a schedule with smtplib and cron, with safe credentials and failure alerts.
We send one email when a new article is published. No spam.