A New Meaning of “Focus Groups”

You now know that once you’ve gathered your information into groups of rows, you can request the MIN, MAX, AVG, SUM, or COUNT of all the values in each group. Suppose you want to refine further the final result set—to focus the groups—by testing one of the aggregate values. Let’s take a look at a simple request.

“Show me the entertainer groups that play in a jazz style and have more than three members.”

Doesn’t sound too difficult, does it? Figure 14-1 shows the tables needed to solve this request.

Figure 14-1. The tables needed to figure out which entertainers play jazz and also have more than three members

Note

We again use the “Request/Translation/Clean Up/SQL” technique introduced ...

Get SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.