An SQL query is a command used to retrieve, insert, update, or delete data from a database. It allows users to interact with the database by specifying the operations they want to perform on the data. SQL queries are written using the Structured Query Language (SQL), a standard language for managing relational databases.