Good evening guys. Please I'm new to `sql`. Trying to write a query to join 3 tables.

This is my result

I have a members table, a departments table and training table.

A member can be in more than one department. And can receive more than one training.

Please how do I relate this together. I tried joining the 3 tables but to my surprise the result outputs a member who is in 2 department twice eg

```
{
   Id: 6,
   name: Toyin,
   department: user
},
{
   Id: 6,
   name: Toyin,
   department: choir
}

```

This is my desired result

All I wanted is

```
{
   Id: 6,
   name: Toyin,
   department: [ user, choir]
}

```

I've been googling since like forever but still not getting it.

Thanks in anticipation