you are mixing 2 different things...
these blocks from your screenshot look like some blocks from @ABG, which are for doing sql stuff in lists, this is not what you need
your data is stored in a Google Spreadsheet, you access it using gviz as described in the tutorial here
the documentation of the query language is here Query Language Reference (Version 0.7) | Charts | Google for Developers
something like this
select name, number, date, time, sum(oeoplenumber)
will not work... if you want to use aggregate functions like sum, then you have to group the data for all other columns, for example
select name, number, date, time, sum(peoplenumber)
group by name, number, date, time
Taifun