set of tables $t$, it uniformly draws the number of query predicates $p_{bt}$ (0 $\leq p_{bt} \leq$ number of non-key columns in table $bt$). Subsequently, for each predicate it uniformly draws a non-key column from the relevant table $bt$, a predicate type $(<,\ =,\ or\ >)$, and a value from the corresponding column values range in the database. To avoid a combinatorial explosion, and to simplify the problem that the model needs to learn, we force the queries generator to create queries with up to two joins and let the model generalize to a larger number of joins. Note that all the generated queries include a SELECT \* clause. They are denoted as *initial-queries*.

To create pairs of queries that are contained in each other with different containment rates, we generate, in the second step, queries that are “similar” to the *initial-queries*, but still, different from them, as follows. For each query $Q$ in *initial-queries*, the generator repeatedly creates multiple queries by randomly changing query $Q$’s predicates’ types, or the predicates’ values, and by randomly adding additional predicates to the original query $Q$. This way, we create a “hard” dataset, which includes pairs of queries that look “similar”, but having 