I have two tables. One call Pessoa
and another call Evento
.
Pessoa
has the id
, name
, and email
fields.
Evento
has the fields id
and pessoa_id
.
The Evento
table contains several events for each Pessoa
.
I would like to group all people, and the number of events related to it. The new table would be:
| Pessoa | Email | Quantidade Eventos |
| nome1 | [email protected] | 5 |
| nome2 | [email protected] | 10 |