As you said, SQL is a query language that is used for databases. A 'query' language when referring to databases means that it is the language used to get information out of the database.
Databases can be very complicated and made up of many tables. SQL is used to get this information out, by using such functions like SELECT, FROM, WHERE, AND, etc.