SQL
Examples
Count the number of entries in the `addresses` table that belong to each different `city`, filtering out cities with a count below 50:  
```sql
SELECT city, count(*)
FROM addresses
GROUP BY city
HAVING count(*) >= 50;
```  
Compute the average income per city per `street_name`, filtering out cities with an average `income` bigger than twice the median `income`:  
```sql
SELECT city, street_name, avg(income)
FROM addresses
GROUP BY city, street_name
HAVING avg(income) > 2 * median(income);
```