Group selection made easy, Outer joins made powerful
Site owned & produced by MagnaFacta

The SQL Generator

The SQL Generator screen transforms input in the shorter Else Logic dialect of SQL into full length SQL acceptable by current database systems.

This tutorial will take you through the possible transformations one step at the time. Following the tutorial is mostly a question of going to a page, studying the input using the explanations, clicking on the "Generate" button and studying the output.

The Generator Screen

Input SQL

Here you enter SQL using the new Else Logic SQL dialect. This should - currently - be an SQL SELECT statement. The transformer will only transform the first SQL statement entered in this box, ignoring the rest. The transformer tries to adapt your use of spaces so use indentation for a readable result.

The transformer understands only a little SQL. If your input contains invalid SQL this may result in an error or it may retain the error in the output.

Remove input comments

Check to remove any SQL comments from the input before transforming. On by default as the resulting SQL can be long enough without comments.

Show changes

Check to see the results of each transformation step. Do check this option whenever the results are not clear to you.

Show result data

This choice appears only on the tutorial pages. When checked the page shows a table containing the result of executing the query against the test database. This is a nice help in making things clear.

Output SQL

A text area that appears after clicking the generate button. Use it to copy & paste the result for use or testing with your own database.

The first transformation

For this first transformation we use an SQL expression without any Else Syntax. We use the query from the Excel example:

"show the sales of departments selling apples"

The first steps in this tutorial will just shorten the SQL for this query. The later steps will use more complex versions of this query to demonstrate the real power of Else Logic.


To see that this is a live transformation, just change the spacing or change some words or use "Show result data" and then apply another filter.

Conditions of use, Copyrights © & Intellectual Property Rights