Glossary · Databases

SQL (Structured Query Language)

SQL is the standard language for defining, querying, and modifying data in relational databases, using statements such as SELECT, INSERT, and UPDATE.

Updated October 6, 2026

SQL (Structured Query Language) is the standard declarative language for working with relational databases. You describe what data you want, and the database decides how to fetch it.

Why it matters

SQL is the common language across PostgreSQL, MySQL, MariaDB, SQLite, and many commercial systems, so skills transfer between them. Statements fall into groups: querying (SELECT), changing data (INSERT, UPDATE, DELETE), defining structure (CREATE, ALTER, DROP), and controlling access or transactions (GRANT, COMMIT). Each vendor adds its own extensions, so portable code needs care.

Example

SELECT name, email
FROM customers
WHERE country = 'IN'
ORDER BY name
LIMIT 10;

This returns the first ten customers from India sorted by name. Nothing in the statement says which index or scan to use; the optimizer chooses.

Common mistakes

  • Building queries by concatenating user input into strings, which opens the door to SQL injection. Use parameterized queries.
  • Using SELECT * in application code, which pulls unneeded columns and breaks when the table changes.
  • Assuming SQL behaves identically everywhere. Date functions, quoting, and LIMIT syntax differ between systems.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.