connected queries from front to back