ArcGIS Pro 2.6.8; Oracle 18c 10.7.1 EGDB; SDE.ST_Geometry:
Background:
In the Select Layer By Location (Data Management) docs, the Relationship Parameter — Intersect (DBMS) section says:
For the Relationship parameter, the Intersect (DBMS) option may provide better performance than the Intersect option when using enterprise geodatabase data; however, this option is only supported under specific conditions. If all conditions are met, the spatial operation will be performed in the enterprise geodatabase database management system (DBMS) rather than on the client.
...The user connecting to the geodatabase must have privileges to create a view in the database where the feature classes are stored.
In other words, the tool creates a database view called SELECTIONOUTPUTNAME.


select "OBJECTID" from ( SELECT a.OBJECTID FROM INFRASTR.ACTIVE_TRANSPORTATION a,
INFRASTR.AGOL_PARKINGLOT b WHERE SDE.ST_INTERSECTS(a.SHAPE, b.SHAPE) = 1 ) esri_sql
Idea:
Rather than hide the SQL query definition in an obscure database view, allow the user to easily access the SQL by including the SQL as text in the GP tool details. Or something better.

Use Cases:
- Copy/paste the text for documentation purposes.
- Use the SQL elsewhere. Spatial SQL queries can be tricky to write from scratch, especially when using unfamiliar spatial types. It would be helpful to grab SQL from a working query and then modify it for other purposes.