Correlating Tables in Zabbix ( mysql)?

Apologies for any stupid questions, I just started looking at all of this, this week.

I’m trying to make a new dashboard. I want to show data from a Zabbix Database which is Mysql. I have a table “Items” which contains a lot of data, one grouping is “CPU % Free” with fields to a foreign key for Host and Group. The time stamp is in seconds since Epoc.

How do I set up a query that say something along the lines of “show me a history of the CPU % Free over the last 30 days” as independent items ( a line for each host ) but also with a line for an Average of all hosts?