refactor query producing for sql, sql producer.


![screen shot 2014-08-11 at 00 23 18](https://cloud.githubusercontent.com/assets/2864497/3870754/f7e9acd4-20dc-11e4-8577-9576cce38fe7.png)
Added SQL handling in a convenient way, showing up sql queries in inspect.