> For the complete documentation index, see [llms.txt](https://anton-veselskyi.gitbook.io/codding-problems-solutions/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://anton-veselskyi.gitbook.io/codding-problems-solutions/codewars/6-kyu/sql-basics-simple-having.md).

# SQL Basics: Simple HAVING

## [SQL Basics: Simple HAVING ](https://www.codewars.com/kata/58164ddf890632ce00000220)

For this challenge you need to create a simple HAVING statement, you want to count how many people have the same age and return the groups with 10 or more people who have that age.

### people table schema

* id
* name
* age

### return table schema

* age
* total\_people

> NOTE: Your solution should use pure SQL. Ruby is used within the test cases to do the actual testing.

## Solutions

#### 🗃️ Sql

```sql
select age, count(age) as total_people
from people
group by age
having count(age) >= 10;
```
