This metric is only a theoretical metric.
Two queries are said to be semantically equivalent if they give the same results on all possible databases. In other words, they are indistinguishable.
We will denote it by:
The Query matching accuracy
In theory,
With that, this metric is not practical, and we propose the other metrics as an approximation of
If SQL queries are of type 3, it can be argued that the size of the query is generally small. If that is the case, and implementation of query similarity is found in COSETTE[2].