A Case Study for Analytics Using SQL
So far in this book, you have learned about the various features and functionalities offered by SQL. Now, if you take a step back and think about the fundamental question of “why” (i.e., why do you need these features and functionalities at all), you will see that it all stems from the need for data analysis.
Data originates in individual activities. Each activity creates its own data point and context. When the data of all the activities in a certain domain is collected and grouped together, statistical patterns emerge. As discussed from the very first chapter of this book, ancient Egyptian pharaohs collected census information to determine the size of the army they could recruit, and modern companies dive into sales data to find the most attractive products for promotion. All these involve the same process of gathering activity level data (the number of people in each household, or the quantity and amount of each sales transaction...