We have a flex based front end, that talks via JDBC to some databases.
Part of the GUI has some forms that let the users construct Queries in SQL to pull back records from the database.
However, we get a lot of support tickets that relate to incorrect SQL being tapped in, and a general lack of SQL knowledge so that they struggle with creating queries.
It would make more sense if we could have some sort of validation like a SQL Query builder.
Currently we do have a 'Test SQL' command that validates if it returns a valid result from the db, but I would like to take this further and have something that lets you build queries.
Has anyone seen any good examples on how to achieve this within a Flex based front-end? (or even non-flex, just to give us some design ideas).
Let me know if you need more details via comments.
--Edit--
Just for some background, here is a link to what the GUI currently looks like.
Its a wizard based forms approach, of which entering SQL is a part of:

Id prefer to see more options here for building the SQL with perhaps some sort of 'SQL calculator'? Or open to other suggestions - this also ties in with UX.