Skip to content
Scan a barcode
Scan
Paperback SQL Practice for Data Analyst Interviews: 60 Real Problems in PostgreSQL. Window Functions, CTEs and Modern Query Patterns, on Any Computer Book

ISBN: B0HH3J9PMN

ISBN13: 9798170515073

SQL Practice for Data Analyst Interviews: 60 Real Problems in PostgreSQL. Window Functions, CTEs and Modern Query Patterns, on Any Computer

The query ran. The number was wrong.

Most SQL interview practice stops at the point where the query runs. In an interview, the query almost always runs. What separates candidates is whether the number it returns is the number somebody actually asked for.

This book is sixty problems, each one built around a specific way to be silently wrong:

a join that quietly doubles your revenuea NOT IN that returns nothing, and no errora window frame that averages seven rows when you asked for seven daysa cohort chart whose empty cells look like a collapse in retentiona LEFT JOIN undone by the WHERE clause beneath itYou practise on a real database, not a toy

Nine tables. 186,000 listening events. Three years of billing, subscriptions, support tickets and plan changes. One file, five minutes, PostgreSQL or Docker on Windows, macOS or Linux. The data is generated from fixed rules, so your results match the printed ones to the cent.

Every query in this book was executed before it was printed

Every result you see was copied from a real run against that database, not typed from memory. Where a measured result contradicted what the author expected, and twice it did, the book prints the measurement and says so.

What is inside

Part 1 Warm-ups that hide a trap. Part 2 Joins, and the rows you did not mean to create. Part 3 Aggregation. Part 4 Subqueries and CTEs. Part 5 Window functions, the largest part. Part 6 Dates, cohorts and retention. Part 7 Text and JSON. Part 8 Nine timed interview simulations with no hints.

Each problem gives you the ask, the shape of the answer, three hints you can take one at a time, a worked solution, a discussion of what the trap was, and a note on what the interviewer is listening for.

Back matter includes the same operations on MySQL, SQL Server, Snowflake and BigQuery, and an index of all sixty traps by category, the page to read the night before.

Who this is for

You can already write SELECT, WHERE, GROUP BY and a basic join. You are applying for data analyst or analytics engineering roles. You freeze when the interviewer says "now rank each customer by spend within their region."

If you have never written SQL before, start elsewhere and come back.

Recommended

Format: Paperback

Condition: New

$22.99
Ships within 2-3 days
Save to List

Customer Reviews

0 rating
Copyright © 2026 Thriftbooks.com Terms of Use | Privacy Policy | Do Not Sell/Share My Personal Information | Cookie Policy | Cookie Preferences | Accessibility Statement
ThriftBooks ® and the ThriftBooks ® logo are registered trademarks of Thrift Books Global, LLC
GoDaddy Verified and Secured