Skip to main content
Definition Website Computer and Technology

Structured Query Language

Subject: Computer and Technology noun /ˈstrʌk.tʃərd ˈkwɪr.i ˈlæŋ.ɡwɪdʒ/ 1 definition

  1. Definition (noun)

    Entry #61 · Updated

    Structured 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, and DROP that establish, modify, or remove tables, views, indexes, and integrity constraints.

    • Data Query Language (DQL): Read-oriented retrieval statements centered on SELECT, pairing clauses like JOIN, WHERE, GROUP BY, and HAVING to filter, combine, and aggregate rows.

    • Data Manipulation Language (DML): Record-modifying statements—primarily INSERT, UPDATE, DELETE, and MERGE—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, and ROLLBACK that 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, and GROUP BY across the orders and products tables. 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.