querying multiple tables for response