C2/cocoonJS projects are executed in javascript, client-side. SQL is server side. So no, you can't use SQL calls right from C2.
But you can use the AJAX object to send and pull data from URLs. Doing so, you can send data to your server where, server-side, you will be able to use SQL and then send data back.