add tests for homogeneous/heterogeneous query.
add minimal working versions for queries

- since they rely on ruby's select method,
  they are quite slow and will be optimized
  by an sql-query later.