The easiest way (in my opinion)
Is to create a REST service that communicates with your SQL database, And from there make REST calls to your service in javascript, using this guide as an example.
You should also read thisthis, which is a similar question to yours