Relational database systems come with query languages that help users to query database instances. A query language allows users to request information from the database, with SQL (Structured Query Language) being a common example. Queries can be seen as "retrieval programs."
There are two main types of query languages:
⇒ Users instruct the system to perform a series of operations to get the desired results.
⇒ Users specify what data to retrieve and how to retrieve it.
⇒ Users specify the desired result without detailing the steps to achieve it.
⇒ Users tell what data to retrieve but not how to retrieve it.
There are two "pure" query languages, which are mathematical in nature:
A procedural query language.
⇒ It is operational and useful for representing execution plans.
⇒ Users specify what data is required and how to get that data.
A non-procedural query language.
⇒ Includes Tuple Relational Calculus and Domain Relational Calculus.
⇒ Users specify what data they want without specifying how to get it.