It depends on what purpose you're working on. The most common for language for the queries themselves is SQL. That gets you the raw data. There are other database styles, but relational databases (MySQL, PostgreSQL, Oracle, SQLite) are dominate.
For simple to medium complexity web-related projects PHP is a great language. The language itself is mediocre, but it does its job well. It can easily run on all popular web servers.
Personally, I recommend staying away from C for your uses. It's great for low level programming and raw speed but it lacks modern features that you'll need. Prominent users are the GNU tools, the GNOME project, every kernel, and most embedded systems.
C++ is an improvement, but you will quickly get sick of the "Segmentation Fault" message and memory leaks. However, C++'s GUI toolkits and speed are excellent. Prominent users are Mozilla, IE, Opera, high performance 3D games, and KDE.
I haven't used Java so I don't have much to say about it. I know that it's heavily used in many applications that need heavy database work. That includes web servers, some GUIs (though C++ is more prominent there), and many embedded systems. It has an impressive standard library. It used to be slow but huge improvements have been made. It can easily interact with several other languages (Ruby, Python, etc.). It runs on most platforms and most browsers.
C# from Microsoft fits the same general niche. However, it is only solidly supported on Windows. Avoid it on Unix/Linux.
There are various general purpose scripting languages out there. They tend to be easy to develop with, but relatively slow. The big ones I know about are Ruby, Python, and Perl. I often use Python, but you should look take a peek at all of them.