Query content-based data generation includes obtaining a query having an outer query and one or more subqueries, converting predicates of a subquery to be predicates of the outer query, and thereby obtain a transformed query, generate from the transformed query a query block having a list of predicate(s) selected from the transformed query, obtaining column information based on the list of predicate(s) and using the column information to select data for a dataset such that data records from the dataset are produced as results to executing the obtained query against the dataset.