SQL stands for Structured Query Language - it's a standard for interacting with database servers. Of those you've mentioned MySQL, MSSQL, there are also other ones like Oracle etc. Each of these has a huge overlap of commands, but there are some that are slightly different, so choose one and stick to it (personally I use MySQL, but so long as you know the command set for what you use you'll be ok).
Being a standard means it is well documented, if you look up the rfc on SQL (sorry, not got the number handy) it'll explain all protocol stuff, the other option is to find a link library etc if you're going to use something like C. PHP has a module to use it, and no doubt there are modules for other languages to. If you want to get down and dirty then do the communications layer yourself, it's not *that* hard.
Robin