Query & compose an array

Hi there,

What's the correct & most efficient way to compose the following array?

I have:

Existing tables: