Structured Query Language
Subject: Computer and Technology noun /ˈstrʌk.tʃərd ˈkwɪr.i ˈlæŋ.ɡwɪdʒ/ 1 definition
- database-systems
- query-languages
- relational-databases
- data-management
-
Definition (noun)
Entry #61 · UpdatedStructured Query Language (SQL) is a standardized, domain-specific declarative language used to define, manipulate, query, and govern data stored in relational database management systems (RDBMS). Rather than specifying step-by-step procedural instructions for traversing records, SQL allows developers to declare the desired schema changes or result sets while the database engine's query optimizer determines the execution plan. Standardized by ANSI and ISO and implemented with vendor extensions across systems such as PostgreSQL, MySQL, Oracle, and Microsoft SQL Server, SQL is purpose-built for set-based relational operations and transactional integrity rather than general-purpose application programming.
Common Forms
Data Definition Language (DDL): Schema-management statements such as
CREATE,ALTER, andDROPthat establish, modify, or remove tables, views, indexes, and integrity constraints.Data Query Language (DQL): Read-oriented retrieval statements centered on
SELECT, pairing clauses likeJOIN,WHERE,GROUP BY, andHAVINGto filter, combine, and aggregate rows.Data Manipulation Language (DML): Record-modifying statements—primarily
INSERT,UPDATE,DELETE, andMERGE—that add, update, or remove data inside existing tables.Data and Transaction Control (DCL and TCL): Administrative and consistency commands such as
GRANT,REVOKE,BEGIN,COMMIT, andROLLBACKthat enforce access privileges and maintain atomic, ACID-compliant transactions.
Example
To calculate monthly revenue by product category in an e-commerce PostgreSQL database, an analyst runs a declarative SQL query combining
SELECT,JOIN,WHERE, andGROUP BYacross theordersandproductstables. The database engine's query planner automatically selects an index scan and hash aggregation to execute the request efficiently and return the summarized totals without requiring procedural loop logic.