Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

SQL terminology: "query" that includes and follows a single "SELECT" statement

Context:

I’m writing an application-specific SQL parser in python, and want to disambiguate my class names.

Question:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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?

SQL example, with highlighted and underlined instances of abstraction to be named

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"

>Solution :

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading