add Query class

it is used for simplifying database queries