What is a query language in DBMS?


Query is a question or requesting information. Query language is a language which is used to retrieve information from a database.

Query language is divided into two types as follows −

  • Procedural language

  • Non-procedural language

Procedural language

Information is retrieved from the database by specifying the sequence of operations to be performed.

For Example: Relational algebra

Structure Query language (SQL) is based on relational algebra.

Relational algebra consists of a set of operations that take one or two relations as an input and produces a new relation as output.

The different types of relational algebra operations are −

  • Select operation

  • Project operation

  • Rename operation

  • Union operation

  • Intersection operation

  • Difference operation

  • Cartesian product operation

  • Join operation

  • Division operation.

Select, project, rename comes under unary operation (operate on one table). Union, intersection, difference, cartesian, join, division comes under binary operation (operate on two tables).

Non-Procedural language

Information is retrieved from the database without specifying the sequence of operation to be performed. Users only specify what information is to be retrieved.

For Example: Relational Calculus

Query by Example (QBE) is based on Relational calculus

Relational calculus is a non-procedural query language in which information is retrieved from the database without specifying sequence of operation to be performed.

Relational calculus is of two types which are as follows −

  • Tuple calculus

  • Domain calculus

Updated on: 06-Jul-2021

10K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements