How a range query works on a simple B+tree
This is up to the individual database system.  There are multiple ways one might index the data and support this type of query.

One natural approach is that the system might compute in advance an index over the x-values (i.e., a B+ tree that is keyed by the x values) and a second index over the y values (i.e., a B+ tree that is keyed by the y values).  Given those indices, you can now implement the search query by doing a range query on the first B+ tree to find all values where x &gt; 10 AND x &lt; 100, then iterate through them and keep the ones that also satisfy y &gt; 20 AND y &lt; 200.

It is also possible to build multi-dimensional data structures that support 2D range queries, but those are more complex and might not be used in a typical database system.