SQL
Also called: Structured Query Language
The language for defining, querying and changing data in a relational database.
Definition
SQL (Structured Query Language) is declarative: a statement says what result you want, and the database's planner decides how to get it, using indexes and statistics. It has statements for structure (CREATE, ALTER, DROP), for data (SELECT, INSERT, UPDATE, DELETE), for permissions (GRANT) and for transactions (BEGIN, COMMIT). PostgreSQL, MySQL, SQLite, SQL Server and Oracle share the standard core and differ in details.
In practice
SELECT name FROM customers WHERE country = 'RS' ORDER BY name; returns Serbian customers sorted by name.
Learn it in context
Lessons that use this term.
Related terms
- Primary keyThe column (or columns) that uniquely identifies each row of a table; never empty, never repeated.
- Database indexA sorted structure on one or more columns that lets the database find rows without reading the whole table.
- Query planThe steps a database chooses to execute a query (scans, index lookups, joins, sorts), shown with EXPLAIN.