
SQL for Data Analytics: Analyze data effectively, uncover insights and master advanced SQL for real-world applications
Author(s): Jun Shan (Author), Haibin Li (Author), Matt Goldwasser (Author), Upom Malik (Author), Benjamin Johnston (Author)
- Publisher: Packt Publishing
- Publication Date: November 21, 2025
- Edition: 4th ed.
- Language: English
- Print length: 336 pages
- ISBN-10: 1836646259
- ISBN-13: 9781836646259
Book Description
Turn SQL into your competitive edge for uncovering patterns and accelerating data-driven business decisions
Key Features
- Solve real business problems with advanced SQL techniques
- Work with time-series, geospatial, and text data using PostgreSQL
- Build job-ready analytics skills with hands-on SQL projects
- Purchase of the print or Kindle book includes a free PDF eBook
Book Description
SQL remains one of the most powerful tools in modern data analytics, helping you turn data into decisions. This book shows you how to go beyond writing queries to deliver insights that matter.
SQL for Data Analytics, Fourth Edition, is for anyone who wants to move past basic SQL syntax and use it to interpret real-world data with confidence. Whether you're trying to make sense of production data for the first time or upgrading your analytics toolkit, this book gives you the skills to turn data into actionable outcomes.
You'll start by creating and managing structured databases before advancing to data retrieval, transformation, and summarization. From there, you’ll take on more complex tasks such as window functions, statistical operations, and analyzing geospatial, time-series, and text data.
With hands-on exercises, case studies, and detailed guidance throughout, this book prepares you to apply SQL in everyday business contexts—whether you're cleaning data, building dashboards, or presenting findings to stakeholders. By the end, you'll have a powerful SQL toolkit that translates directly to the work analysts do every day.
What you will learn
- Write queries to analyze and summarize structured data
- Use JOINs, subqueries, views, and CTEs effectively
- Apply window functions to identify patterns and trends
- Perform statistical analysis and hypothesis testing in SQL
- Analyze JSON, arrays, geospatial, and time-series data
- Improve SQL performance using indexes and query plans
- Load data with Python and automate analytics workflows
- Complete a case study to experience solving real-world analytics problems
Who this book is for
This book is for aspiring data engineers, backend developers, analysts, and students who want to use SQL for real-world data analytics. You should have basic SQL and college-level math knowledge, and along with the desire to advance your skills in data transformation, pattern recognition, and business insight delivery.
Table of Contents
- Introduction to Data Management Systems
- Creating Tables with Solid Structures
- Exchanging Data Using COPY
- Manipulating Data with Python
- Presenting Data with SELECT
- Transforming and Updating Data
- Defining Datasets from Existing Datasets
- Aggregating Data with GROUP BY
- Inter-Row Operation with Window Functions
- Performant SQL
- Processing JSON and Arrays
- Advanced Data Types: Date, Text, and Geospatial
- Inferential Statistics Using SQL
- A Case Study for Analytics Using SQL
Editorial Reviews
Review
“SQL for Data Analytics is an excellent book for analysts, programmers, and anyone who wants to delve into SQL and learn how to navigate data in relational databases. The authors use exercises to build hands-on skills and activities to demonstrate how to solve business problems, reinforcing what the reader is learning. This book covers a broad spectrum of SQL topics and adds more value with its coverage of real-world data problems like handling JSON. I would recommend this book as a great way to learn SQL and broaden your data analytics skills.”
Steve Hughes, Microsoft Data Platform MVP, Founder of Data On Wheels, Author of Hands-On SQL Server 2019 Analysis Services and SQL Server Analysis Services Cube Development Cookbook
“SQL for Data Analytics, Fourth Edition is an excellent reference work that manages to balance the rigor of the SQL language with the practicality required by professional data analysis. It is highly recommended for students and beginners who wish to teach themselves how to use SQL for data analytics, as well as for professionals who want to consolidate their knowledge of advanced features and optimization. The combined expertise of the authors, including Jun Shan, who has over 20 years of professional experience in the data management field, guarantees the reliability and relevance of the content.”
Enrico Pirozzi, Cofounder at datainf and Author of Learn PostgreSQL
“SQL for Data Analytics, Fourth Edition is an exceptional blend of clarity, structure, and practical depth. It bridges the gap between classroom learning and real-world analytics through hands-on PostgreSQL exercises and modern data science integration. A must-read for anyone serious about building a strong foundation in data analytics.”
Vijay Kumar Reddy Voddi, Ph.D. (c) in Data Science, Director of Data Science Programs at Saint Peter’s University
“As somebody who has been working with Structured Query Language for over 30 years, and teaching it for almost 15, I find this book essential for any data science professional who aims to learn, to practice, and/or to optimize their knowledge of the language. [...] The structure of this book, coupling hands-on exercises with the explanation of the subject matter, is key to knowledge retention and ultimately to its application. The authors have done a tremendous job in structuring this text and focusing it directly on the needs of the data scientists of today as well as tomorrow.”
Michael Coakley, Chief Information Officer, Adjunct Professor of Computer Science and Information Technology at Columbia University
About the Author
Jun Shan is a principal cloud solution advisor and data architect with 20+ years of professional experience. He has been working in the data management field since the beginning of his career and has delivered data solutions to various companies, such as Amazon and Bank of America. He also teaches about relational databases and SQL at several universities. Jun is the author of SQL for Data Analytics,Third Edition, and received his Master of Science in Computer Science from Virginia Tech.
Haibin Li obtained his Ph.D. in Atmospheric Science from Rutgers University. He is currently a lead predictive modeler with a decade of data science experience in the insurance industry. He has extensive working knowledge of data management and SQL. Hiabin is the technical reviewer of SQL for Data Analytics, Third Edition.
Matt Goldwasser is Vice President and Head of AI and Data Science for Global Distribution at T. Rowe Price. He leads strategic initiatives using machine learning (ML) and advanced analytics across the organization. With over 8 years at T. Rowe Price, he brings expertise in applied data science, MLOps, and AWS, with a strong focus on operationalizing AI at scale. Previously, Matt held multiple roles at OnDeck, leading marketing analytics and building predictive models and automated ML pipelines. He also worked in data engineering, risk analysis, and product management at Millennium Management, GE, and the Port Authority of NY and NJ. He is known for turning complex challenges into scalable solutions and bridging strategy with hands-on innovation.
Upom Malik is a data science and analytics leader who has worked in the technology industry for over eight years. He holds a master's degree in chemical engineering from Cornell University and a bachelor's degree in biochemistry from Duke University. As a data scientist, Upom has overseen efforts across machine learning, experimentation, and analytics at various companies throughout the United States. He uses SQL and other tools to solve complex challenges in finance, energy, and consumer technology. Outside of work, he enjoys reading, hiking the trails of the Northeastern United States, and savoring ramen bowls from around the world.
Benjamin Johnston is a senior data scientist for one of the world's leading data-driven MedTech companies and is involved in the development of innovative digital solutions throughout the entire product development pathway, from problem definition to solution research and development, through to final deployment. He is currently completing his Ph.D. in ML, specializing in image processing and deep convolutional neural networks. He has more than 10 years of experience in medical device design and development, working in a variety of technical roles, and holds a first-class honors bachelor's degree in both engineering and medical science from the University of Sydney, Australia.
finelybook
