Generate queries along with sequence_no query