generate queries for train dataset