Query Languages

Summary: Languages used to retrieve and manipulate data in a database, categorized as declarative or imperative.

Sources: raw/chapter2

Last updated: 2026-04-15


Declarative Query Languages

In a declarative language (like SQL, Cypher, or SPARQL), you specify the pattern of the data you want, but not how to achieve that goal (source: chapter2, p. 43).

  • Advantages: More concise, easier to work with, and hides implementation details of the database engine.
  • Optimization: Allows the database’s query optimizer to introduce performance improvements without requiring changes to queries (source: chapter2, p. 43).
  • Parallelism: Better chance of getting faster in parallel execution because they specify only the pattern of results, not the algorithm (source: chapter2, p. 43).

Imperative Query Languages

An imperative language tells the computer to perform certain operations in a certain order (source: chapter2, p. 43). Examples include IMS and CODASYL.