Group-By Summaries - Business Analytics
- What is the average order value across all completed orders? Answer: , obtained by weighting each regional average by its order count Whenever you see a question combining multiple group averages, your instinct should be to ask: are all groups the same size? If not, a simple average of the averages will mislead you — you need a weighted average. Here, the three regions have different order counts (25, 35, and 40), so each regional average must be weighted by how many orders it represents. Multiply each average by its order count, sum the results, then divide by total orders: That confirms C is correct. B is the classic trap: averaging , , and equally gives , but this treats a 25-order region identically to a 40-order region, which distorts the result by overweighting smaller groups. A is a fabricated method — "giving the largest region the greatest adjustment" is not a real statistical technique, and doesn't follow from any standard calculation here. D simply grabs the middle regional average () and calls it the overall average, which ignores both the other regions and the order counts entirely. Study tip: On any question involving combined averages, check whether group sizes differ. If they do, always weight — the formula is . Unweighted averaging of averages is one of the most common traps in business analytics questions.
- Which conclusion is best supported when the channel-level groups are also aggregated overall? Answer: A converts at and B at about , but channel composition confounds the aggregate comparison Whenever you see aggregated data split by subgroups, your first instinct should be to check for Simpson's Paradox — a situation where a trend that appears in combined data reverses or disappears when you examine the subgroups separately. Here's what the numbers actually show. Variant A: conversions out of users, giving an overall rate of . Variant B: conversions out of users, giving . So D's arithmetic is exactly right. But here's the critical insight: B's aggregate rate looks higher only because B was disproportionately exposed to the paid channel, where both variants convert well. Within each channel, A is actually competitive or superior — A converts at vs. B's in paid, and vs. B's in organic. The channel mix, not the variant itself, drives the aggregate gap. That's confounding, not causation. A is wrong because averaging the channel-level rates with equal weight ( for A, for B) ignores the actual user counts — you must weight by sample size. B is wrong because it fabricates a rule about using only paid-channel denominators, which has no statistical basis. C gets the math right but draws a causal conclusion from a confounded aggregate, which is the core mistake Simpson's Paradox warns against. When you see aggregate vs. subgroup comparisons on the exam, always ask: are the groups compositionally balanced? If not, aggregate rates can be deeply misleading.
- Which set of grouped results should the summary return under standard SQL null handling? Answer: Average , nonmissing count , and row count Whenever you see a SQL aggregation question involving nulls, your first instinct should be to recall how each function treats missing values differently — this is one of the most frequently tested distinctions in business analytics. Under standard SQL,
AVG()andCOUNT(column_name)both ignore null values, whileCOUNT(*)counts every row regardless of nulls. With that framework in mind, walk through the data: the three non-null resolution times are , , and minutes.AVG(resolution_minutes)sums those three values — — then divides by the count of non-null values, giving minutes.COUNT(resolution_minutes)counts only non-null entries, returning .COUNT(*)counts all four rows in the group, returning . This matches answer B. A is wrong on two counts: it divides by (incorrectly including the null in the denominator) to get , and reports a nonmissing count of rather than . C gets the average right but swaps the two counts — it reports the nonmissing count as and the row count as , which is backwards. D ignores the -minute record entirely, as if zero were also missing; is a valid value and must be included in calculations. A quick memory anchor: think ofCOUNT(column)as "count what's actually there" andCOUNT(*)as "count the seats at the table, empty or not." On exam questions, always check whether a zero value is being confused with a null — they are fundamentally different in SQL. - Which monthly group-by summary correctly measures the requested KPI? Answer: Use
AVG(ending_inventory)to report units as average daily ending inventory When a question asks for an average daily value, your job is to identify which aggregation function mathematically produces a mean — not a total, not an extreme. This question tests whether you can match the right SQL aggregate to the right business KPI. Since management wants average daily ending inventory, you need to sum the observed values and divide by the number of days: units. That's exactly whatAVG(ending_inventory)computes, making C the correct answer. It directly answers the question as stated. The distractors each represent a common analytic mistake. A usesSUM, which produces units — a cumulative total across all snapshots. This would be meaningful if you were measuring total inventory-days or warehouse throughput, but summing ending snapshots doesn't yield a representative daily level; it overstates the figure by a factor of three. B usesMAX, returning units — the single peak day. This might be useful for capacity planning, but it ignores the lower-inventory days entirely and distorts the typical picture. D usesMIN, returning units — the lowest observation. Like MAX, it discards most of the data and represents a worst-case floor, not a typical level. A useful rule of thumb: match the aggregation function to the business question word-for-word. "Average" →AVG. "Total" →SUM. "Peak" →MAX. "Floor" →MIN. On business-analytics exams, wrong answers often use plausible-sounding functions that measure something related but fundamentally different from what was requested. - Which SQL-like sequence correctly produces the requested group-by summary? Answer:
WHERE status = 'Completed' GROUP BY region HAVING SUM(profit) > 50000When working with SQL aggregation, the order of clauses matters enormously — and so does understanding when each clause filters data. The key framework here is:WHEREfilters individual rows before grouping, whileHAVINGfilters groups after aggregation. Keep that sequence in mind and this question becomes straightforward. The manager wants regions where the total profit from completed orders exceeds . Answer A handles this perfectly. First,WHERE status = 'Completed'removes any non-completed orders from consideration. ThenGROUP BY regionbundles the remaining rows by region. Finally,HAVING SUM(profit) > 50000checks whether each region's combined profit clears the threshold — exactly what was requested. B is invalid becauseHAVINGcannot filter on a non-aggregated column likestatusafter grouping has already collapsed the rows. Thestatusfilter must happen before grouping, usingWHERE. C appliesprofit > 50000in theWHEREclause, which incorrectly eliminates individual orders under — but the passage explicitly says individual orders need not exceed that amount. This would exclude valid orders and undercount regional totals. D usesAVG(profit)instead ofSUM(profit), which answers a completely different question (average order profitability per region, not total), making it the wrong aggregate function for the stated goal. A useful memory aid: think of the clause order as a pipeline — WHERE narrows the raw rows, GROUP BY bundles them, HAVING filters the bundles. Any answer that disrupts this pipeline or uses the wrong aggregate is a trap. - What regional order total will the joined-data summary report? Answer: because the first order total appears on two joined rows Whenever you join tables in analytics, you need to track how many rows each record produces in the result — because aggregate functions like
SUMoperate on rows, not on logical entities. Here's what happens in this scenario. Order 101 has two item rows inOrderItems, so after joining, it appears twice in the result, each time carrying its order total. Order 102 has one item row, so it appears once with its total. When you callSUM(order_total), you're summing all rows: . That confirms D is correct — the duplication of order 101 inflates the sum. A describes the intended outcome if you had deduplicated first (e.g., by aggregating order totals before joining, or usingDISTINCTcarefully). is the correct business answer, but it's not what this flawed query produces. B introduces averaging, which no part of the query performs —SUMandAVGare entirely different aggregations, and nothing here divides by two. C gets the duplication concept partially right but claims only , as if order 102 were also doubled — it wasn't, because it has only one item row and therefore appears only once. As a study habit, whenever you see a join followed by an aggregation, always ask yourself: "How many rows does each source record produce after the join?" Fan-out from one-to-many relationships is one of the most common sources of inflated metrics in real-world data pipelines. - How should an analyst group the transactions to obtain accurate Pacific daily sales summaries? Answer: Convert each timestamp to Pacific time, extract its local date, and then group by that date When working with time zone conversions in business analytics, your goal is always to ensure each transaction is counted in the time period as experienced by the business, not as recorded by the server clock. The passage gives you a perfect illustration: a UTC timestamp of on March 1 actually occurred at Pacific time on February 28 — a full calendar day earlier. If you trust the UTC date at face value, that sale gets counted on the wrong day, distorting your daily summaries. The correct approach, answer A, is to convert every timestamp to Pacific time first, then extract the local date, and finally group by that date. This guarantees each transaction lands in the Pacific business day where it truly belongs. B is a common trap: grouping by UTC date and simply relabeling the groups as "Pacific" doesn't move the data — it just renames incorrectly assigned buckets. The underlying mismatch remains. C compounds the error further by aggregating at the UTC hour level and assigning everything to a UTC date, which ignores time zone offsets entirely and produces summaries that are meaningless for Pacific business reporting. D sounds like a shortcut but fails because subtracting one day from every UTC date is wrong — not all UTC timestamps fall on a different Pacific calendar day. A transaction at UTC, for example, is Pacific time on the same date, so blindly subtracting a day would shift it incorrectly. As a study habit, whenever you see time zone questions, ask yourself: "In whose local time does this event actually fall?" Convert first, then aggregate — never the reverse.
- Which statement correctly describes the companywide distinct-customer count? Answer: It is because the overlapping customers must be subtracted once Whenever you see a question involving counts across overlapping groups, reach for the Inclusion-Exclusion Principle: . This formula prevents you from double-counting members who belong to both groups simultaneously. Here, the East group has distinct customers and the West has , but customers appear in both totals. Simply adding gives , but that counts those shared customers twice — once in each regional bucket. Subtracting the overlap once corrects this: . So the true companywide distinct-customer count is 100, making C correct. Choice A reaches by treating the two regional counts as if they contain entirely separate people, which would only be valid if no customer ever purchased in both regions. Choice B arrives at with no clear mathematical basis — it seems to add the overlap rather than account for it, which has no grounding in set logic. Choice D subtracts the overlap twice (once from each regional total), producing , but that over-corrects: the overlap only needs to be removed once from the combined sum, not once per region. A useful pattern to remember: any time a business-analytics question mentions customers (or orders, transactions, etc.) who qualify under multiple segments, flag it as an Inclusion-Exclusion scenario. The trap is almost always simple addition — your instinct to subtract the overlap once is what separates the right answer from the most tempting distractor.
- What is the model's overall RMSE across all observations? Answer: Approximately , found by weighting squared errors by segment size and then taking the square root Whenever you combine error metrics across groups of different sizes, you must respect what those metrics actually represent. RMSE is the square root of an average of squared errors, so combining RMSEs requires you to work in the squared-error space, weight by observations, then return to the original scale. Here's the correct approach for answer B: first convert each RMSE back to its Mean Squared Error (MSE). Segment X has and Segment Y has . Next, compute the pooled MSE by weighting each segment's MSE by its share of total observations: . Finally, take the square root to return to RMSE units: . That's your overall model RMSE. A is wrong because you cannot average RMSE values directly with size weights — skips the critical squaring step, producing a number with no valid statistical meaning. C is wrong because it ignores the size imbalance entirely, treating an 80-observation segment the same as a 20-observation one — a simple unweighted average of . D actually computes the correct pooled MSE () but forgets to take the square root, leaving the answer in squared-error units rather than original units. Remember: RMSE → square → weight → average → unsquare. Any shortcut that skips a step in this chain will trap you.
- Which aggregation most directly calculates the desired conversion rate for each variant? Answer:
COUNT(DISTINCT CASE WHEN event_type = 'purchase' THEN user_id END) / COUNT(DISTINCT user_id)When working with event-level data, the biggest trap is confusing event counts with user counts. Since one user can generate many rows, raw row counts don't represent people — and this question is explicitly asking about the percentage of users who converted, not the percentage of events that were purchases. The correct approach, answer B, directly maps to the definition: take the number of distinct users who made at least one purchase, divide by the total number of distinct users in the variant.COUNT(DISTINCT CASE WHEN event_type = 'purchase' THEN user_id END)returns each purchasing user exactly once regardless of how many purchase events they generated, andCOUNT(DISTINCT user_id)gives the true denominator — all assigned users. That ratio is precisely the conversion rate you want. Answer A divides purchase events by total rows, so a user with five purchases inflates the numerator and a user with many non-purchase events inflates the denominator — the result has no clean interpretation as a user-level conversion rate. Answer C flips the fraction entirely, putting purchasing users in the denominator and all users in the numerator, which would give a number greater than 1 whenever fewer than all users converted — mathematically inverted. Answer D correctly identifies purchasing users in the numerator but divides byCOUNT(*), the total number of rows, not total users — mixing user-level counting with row-level counting produces a deflated, uninterpretable rate. A reliable rule of thumb: whenever your desired metric is "percentage of users who did X," both your numerator and denominator should useCOUNT(DISTINCT user_id)— one filtered, one not.