Relational Query Languages
Relational algebra is used to break the user requests and instruct the DBMS to execute them. Relational Query language is used by the user to communicate with the database. They are generally on a higher level than any other programming language.
This is further divided into two types
- Procedural Query Language
- Non-Procedural Language
Procedural Query Language
The user instructs the system to perform a set of operations on the database to determine the desired results.
Non-Procedural Language
The user outlines the desired information without giving a specific procedure for attaining the information.
Relational Algebra
The query language ‘Relational Algebra’ defines a set of operations on relations.
Consider STUD, DEPT and FACULTY DATABASES.
There are five types of operators :
- Select (𝛔) : Returns rows of the input relation that satisfy the predicate.
- Projection(ℼ) : Outputs specified attributes from all the rows of the input Relation. Remove duplicate tuples from the output.
- Natural Join (|X|) : Outputs pairs of rows from the two input relations that have the same value on all common attributes.
r1 |X| r2
- Cartesian Product (X) : Outputs all pairs of rows from both input relations.
r1 X r2
- Union (U) : Outputs the union of tuples from both the relations.
r1 U r2
DBMS of Relational Query Languages.