Follow our Telegram channel to get notified instantly whenever new books are published.
Data Analysis Basics With SQL – Edward Jessy

The average function calculates the mean based on the number of non-null values, not the total number of rows. Let us look at an example. Imagine a table of five students and their test scores: 1. Student A: 100 2. Student B: 90 3. Student C: 80 4. Student D: 0 (Did poorly) 5. Student E: NULL (Did not take the test) If you calculate the average manually by adding 100, 90, 80, and 0, you get 270.
If you divide by 5 (the total number of students), the average is 54. However, SQL handles this differently. SQL ignores the NULL value entirely. It sees the sum as 270, but it divides by 4 (the count of students who actually have a score). The result returned by SQL would be 67.5.
Neither answer is necessarily “wrong,” but they represent different questions. SQL answers the question: “What was the average score among those who took the test?” It does not answer: “What was the average score for the whole class?” As an analyst, you must ensure your query answers the correct business question. Extremes and Boundaries: MIN and MAX Often, the most interesting data points are the outliers. Who is our highest- paid employee? What is the cheapest product we sell? When was the first order placed? The MIN (minimum) and MAX (maximum) functions allow us to find these boundary values.
SELECT MIN(Price) FROM Products; SELECT MAX(Price) FROM Products; While these functions are obvious when applied to numbers, they are surprisingly versatile because they also work with text and dates. MIN and MAX with Dates When applied to date columns, MIN finds the earliest date (the oldest record), and MAX finds the latest date (the most recent record). SELECT MIN(HireDate) FROM Employees; This query returns the hire date of the longest-serving employee. This is incredibly useful for finding the range of a dataset, such as determining the start and end dates of a fiscal quarter within a transaction log.
MIN and MAX with Text When applied to text columns (strings), these functions look at alphabetical order. MIN will return the value that would appear first in a dictionary (closest to “A”), while MAX returns the value closest to “Z”.
No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law. OceanofPDF.com Table of Contents 1. Table of Contents 2. Chapter 1: The Language of Data: Understanding Databases and SQL 3. Chapter 2: Setting the Stage: Installing Your SQL Environment 4.
Chapter 3: The Building Blocks: Tables, Columns, and Rows Explained 5. Chapter 4: Speaking to the Database: Writing Your First SELECT Statement 6. Chapter 5: Finding Exactly What You Need: Filtering with the WHERE Clause 7. Chapter 6: Organizing Your Findings: Sorting Data with ORDER BY 8. Chapter 7: Doing the Math: Arithmetic Operators and Numeric Functions 9. Chapter 8: Text Manipulation: Cleaning and Formatting String Data 10. Chapter 9: Summarizing the Big Picture: Aggregate Functions 11. Chapter 10: Categorizing Data: The Power of GROUP BY and HAVING 12.
Chapter 11: The Relational Concept: Primary Keys and Foreign Keys 13. Chapter 12: Connecting the Dots: Mastering the INNER JOIN 14. Chapter 13: Seeing What Is Missing: LEFT, RIGHT, and FULL JOINs 15. Chapter 14: Stacking Results: Using UNION and UNION ALL 16. Chapter 15: Designing for Success: Data Normalization Basics 17. Chapter 16: Changing the Record: INSERT, UPDATE, and DELETE 18. Chapter 17: Building Your Own: Creating and Modifying Tables 19.
Chapter 18: Queries Within Queries: An Introduction to Subqueries 20. Chapter 19: Troubleshooting: Common Errors and Debugging Tips 21. Chapter 20: Beyond the Basics: SQL for Business Intelligence OceanofPDF.com Chapter 1: The Language of Data: Understanding Databases and SQL The modern world relies heavily on data. Every credit card transaction, website click, and inventory scan generates a digital footprint. For many, this massive influx of information is simply noise—a chaotic static of numbers and text.
However, for the business analyst, developer, and strategic decision-maker, this noise contains the answers to critical business questions. To access those answers, you must learn to speak the language of data. You are likely reading this because you have reached a threshold in your current workflow. Perhaps you have spent years managing massive spreadsheets that crash your computer when you attempt to save them. Maybe you are tired of waiting on the Information Technology department to send reports that are already outdated by the time they arrive. Or perhaps you simply recognize that in the current job market, data literacy is a necessary survival skill.
This chapter serves as your foundation. Before we install software or write code, we must fundamentally alter how we perceive data storage.
This is a short excerpt from the opening of “” by Unknown, quoted for review and introduction purposes. All rights belong to the copyright holders.
Book Information
- Unique ID: 218529e08ae277cd
- File Extension: .pdf
- File Size: 846,390 bytes (0.807 MB)
- Title: –
- Author: Unknown
- Pages: 219
- Language: English (en)
Reading & Word Statistics
- Estimated Reading Time: 228.61 minutes
- Total Words: 45,722
- Total Characters: 274,733
- Average Words per Page: 208.78
- Average Characters per Page: 1254.49
Most Frequent Words
data (449), table (347), database (332), column (240), select (232), query (206), name (178), customers (170), sql (168), order (149), join (138), one (137), columns (123), first (123), chapter (122), customer (119), rows (118), use (118), list (118), orders (118), single (114), key (111), specific (110), row (109), every (107), want (107), need (105), like (104), clause (102), null (102), tables (98), number (95), text (90), business (90), sales (90), two (84), value (83), however (77), often (76), using (72), look (70), cannot (70), primary (69), employees (68), result (66), example (65), new (65), code (64), last (64), now (63), left (63), product (63), see (62), find (58), functions (57), group (55), logic (54), union (53), simply (53), write (53), imagine (53), total (53), region (52), department (51), values (51), results (50), error (50), products (50), inner (49), common (49), without (48), used (48), filter (48), function (48), syntax (47), statement (46), analyst (46), right (45), email (45), price (45), information (44), command (44), sorting (43), queries (43), names (43), unique (43), let (43), many (42), exactly (42), numbers (42), standard (42), average (42), know (42), analysis (41), aggregate (41), count (41), language (40), update (39), ask (39), between (39).
