For the endpoint `api/v2/sql` the parameter to pass queries is `q`. It is important to fix because it is in the SQL API front page. Thanks @ibrahimmenem for spotting it.
https://github.com/CartoDB/developers/pull/338