Topic
SQL
SQL is a language for defining, querying, and changing data in relational database systems.
At a glance
- Read operation
- SELECT
- Common data structure
- Tables of rows and columns
Overview
SQL is a language for defining, querying, and changing data in relational database systems. A query describes a result in terms of tables and operations, while the database chooses an execution approach. Individual systems add their own syntax and capabilities.
Describing a result
Queries can select columns, filter rows, join related tables, and aggregate values. The result depends on the query's conditions and grouping, so a syntactically valid statement can still answer the wrong business question.
Changes and constraints
SQL also defines structures and changes records. Constraints can enforce data rules, and transactions group operations. Applications should bind external values through parameterized interfaces instead of assembling them into query text.
Sources and review
MOOR's explanatory text is supported by the following source links.
- The SQL language tutorial — PostgreSQL
- SQL language reference — SQLite