can i use javascript to save an item to a database using sql script?
no, you'd have to use some serverside processing language , such as php, asp....
Not directly, unless you are working with a client-side database. However, you can hook JavaScript up with a server-side script (whichever backend you'd prefer) using XMLHttpRequest.
As in Javascript on the browser? No, you can't.
Hypothetically you could use AJAX techniques to push SQL commands through a server layer and thence to the database but you really, really wouldn't want to since that would be an unholy mother of all security risks.
You really don't want to do this. If you store SQL in your client-side javascript, you are exposing the details and structure of your database to an attacker. Creating an AJAX method to execute passed in javascript without creating a hole and attacker could use to perform SQL Injection attacks would be quite difficult.