Should Relational Be More Terse

In math, the plus sign (+) is a terse symbol that means addition. Math is not COBOL. (CobolFallacy) Thank goodness!

In relational languages, or partially relational languages like SQL, we have verbose keywords:

  SELECT
  WHERE
  FROM
Essentially, SQL is just another COBOL! It's very English heavy.

Couldn't we replace "WHERE" with a symbol, like how a minus sign in math replaces the english word "SUBTRACT"? I'm thinking about a small "w" symbol, or something like "->" or "~~"

There are disadvantages of using notation or symbols instead of more COBOL-like english; a terse notation can end up looking like Regex or Perl, and is harder to read for the LayMan.

On the other hand, there are advantages of using notation or symbols. We take for granted the plus and minus sign in math, they are very useful. The equal sign is also very terse and useful. Our math would be very ugly and hard to write down on paper if it was COBOL english (CobolFallacy).

An early version of the RelProject used symbols as shorthand aliases for a number of TutorialDee keywords. Whilst + and - are obviously familiar, and any language that uses them in their usual way will benefit from familiarity, there is no such familiarity with symbols in the RelationalAlgebra, even though there are some that are typically used in academic papers. I eventually removed the shorthand aliases from Rel, because no one used them.

Interesting case study - that's some sample empirical/objective statistical evidence that people may not care about the verbosity of relational languages.

{ExBase had an interesting compromise where one could use only the first 4 letters of a keyword if they wanted to shorten the prose. I'm not sure I agree with this approach; the jury's still out. However, most of the bloat in production SQL is the repetitious and long lists of column names, not the phrase indicators and keywords. The Column Table of SmeQl can help this problem by allowing "relational math" on DataDictionary-like virtual or actual tables to indicate things such as "all columns except the following", Column Tables also facilitate the use of an IDE or TableBrowser(s) to manage and "mark" column lists instead of fiddling with textual column lists. It's somewhat similar to the Query Builder in MS-Access, except that it's vertical instead of horizontal (in most table-browsers).}

{Some of the earliest relational languages used a more math-like notation. But, that encourages infix whereas I felt prefix was more flexible for the purpose of a query language. Plus, English-like makes learning easier. Shortening the keywords (SEL instead of SELECT for example) rather than using symbols would be the better option, at least with prefix. --top}


See also: HowOtherQueryLanguagesAddressSqlFlaws


CategorySyntax, CategoryQueryLanguage


EditText of this page (last edited November 25, 2014) or FindPage with title or text search