Context:
I'm writing an application-specific SQL parser in python, and want to disambiguate my class names.
Question:
Is there a word that unambiguously refers to a single instance of the "SELECT [FROM, etc.]" ordered keyword paradigm in SQL? I think "query" is too broad because a query can include multiple non-overlapping instances of this thing in, for example, CTE declarations. Each one of these things has one SELECT statement, but would also include related FROM, JOIN, WHERE, etc. clauses.
In the example query displayed in this image, there are exactly three of these "things": one highlighted in yellow, one highlighted in orange, and one underlined. (The underlined "thing" also includes the orange-highlighted subquery). Is there a generic name that captures all three, but not the entire query?
I tried asking coworkers and ChatGPT, and got the following suggestions, none of which is IMO a match: "subquery," "temp table," "query," "cte," "select statement"
I think "select statement" is the best bet. a "select statement" is a "select clause" optionally preceded by a "with clause" and optionally followed by a "from clause", etc