Suggest an editImprove this articleRefine the answer for “What is an SQL query?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)An SQL query is an instruction written in SQL that a user or program uses to reach a database, to retrieve, change, or manage data: `SELECT` for reading, `INSERT` for adding, `UPDATE` for changing, `DELETE` for removing. **Key point:** queries can also manage structure, creating or changing tables and the relationships between them (DDL, Data Definition Language); essentially, an SQL query is a way to "talk" to a database.Shown above the full answer for quick recall.Answer (EN)ImageAn SQL query is an **instruction written in SQL**, which a user or program uses to reach a database, to retrieve, change, or manage data. ### The main points 1. **Retrieving data**: a query can pull information from tables. Example: ```sql SELECT Name, Age FROM Employees WHERE DepartmentID = 101; ``` - shows the names and ages of employees in a specific department. 2. **Adding data**: a query can insert new records into a table. Example: ```sql INSERT INTO Employees (Name, Age, DepartmentID) VALUES ('Anna', 28, 102); ``` 3. **Changing data**: a query can update existing records. Example: ```sql UPDATE Employees SET Age = 29 WHERE Name = 'Anna'; ``` 4. **Deleting data**: a query can delete records. Example: ```sql DELETE FROM Employees WHERE Name = 'Anna'; ``` 5. **Managing structure**: queries can create or change tables and the relationships between them (DDL, Data Definition Language). Put simply, **an SQL query is a way to "talk" to a database**, to get the data you need and manage it.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.