- DBMS Tutorial
- DBMS - Home
- DBMS - Overview
- DBMS - Architecture
- DBMS - Data Models
- DBMS - Data Schemas
- DBMS - Data Independence

- Entity Relationship Model
- DBMS - ER Model Basic Concepts
- DBMS - ER Diagram Representation
- DBMS - Generalization, Aggregation

- Relational Model
- DBMS - Codd's Rules
- DBMS - Relational Data Model
- DBMS - Relational Algebra
- DBMS - ER to Relational Model
- DBMS- SQL Overview

- Relational Database Design
- DBMS - Database Normalization
- DBMS - Database Joins

- Storage and File Structure
- DBMS - Storage System
- DBMS - File Structure

- Indexing and Hashing
- DBMS - Indexing
- DBMS - Hashing

- Transaction And Concurrency
- DBMS - Transaction
- DBMS - Concurrency Control
- DBMS - Deadlock

- Backup and Recovery
- DBMS - Data Backup
- DBMS - Data Recovery

- DBMS Useful Resources
- DBMS - Quick Guide
- DBMS - Useful Resources
- DBMS - Discussion

# Explain the select operation in relational algebra (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 −

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.

### Types of Relational Algebra operations

The different types of relational algebra operations are as follows −

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).

## Select operation

It displays the records that satisfy a condition. It is denoted by sigma (σ) and is a horizontal subset of the original relation.

### Syntax

Its syntax is as follows −

σ_{condition}(table name)

### Example

Consider the student table given below −

Regno | Branch | Section |
---|---|---|

1 | CSE | A |

2 | ECE | B |

3 | CIVIL | B |

4 | IT | A |

Now, to display all the records of student table, we will use the following command −

σ(student)

In addition to this, when we have to display all the records of CSE branch in student table, we will use the following command −

σ_{branch=cse}(student)

Hence, the result will be as follows −

RegNo | Branch | Section |
---|---|---|

1 | CSE | A |

To display all the records in student tables whose regno>2, we will use the below mentioned command −

σRegNo>2(student)

The output will be as follows −

RegNo | Branch | Section |
---|---|---|

3 | CIVIL | B |

4 | IT | A |

To display the record of ECE branch section B students, use the given command −

σ_{branch=ECE ^ section=B}(student)

To display the records of section B CSE and IT branch, use the following command −

σ_{Section=B ^ Branch=cse ∨ branch=IT}(student)

Consider the EMPLOYEE TABLE as another example to know about selection operations.

Retrieve information about those employees whose salary is greater than 20,000

If one condition is specified then, we can use the following command −

σ salary > 20,000 (emp)

If more than one condition specified in the query then ( AND: ^, OR:∨ , Not:#, equal: =, >, <, >=, <=)

Relational operator will be used to combine the multiple conditions into a single statement.

Example − In order to retrieve the information of those employee whose salary > 20,000 and working in HOD and Dept no is 20, we can use the following command −

σ salary > 20,000 ^LOC=HOD ^Deptno=20(emp)

- Related Articles
- Explain project operation in relational algebra (DBMS)?
- Explain rename operation in relational algebra (DBMS)?
- Explain union operation in relational algebra (DBMS)?
- Explain intersection operation in relational algebra (DBMS)?
- Explain division operation in relational algebra (DBMS)?
- Explain the relational algebra in DBMS?
- What is join operation in relational algebra (DBMS)?
- Explain cartesian product in relational algebra (DBMS)?
- Explain the binary operations in relational algebra (DBMS)?
- Explain the evaluation of relational algebra expression(DBMS)
- Write queries using aggregate functions in relational algebra (DBMS)?
- Explain the Relational Model in DBMS?
- Explain the unary operations of algebra relations in DBMS?
- Difference between Relational Algebra and Relational Calculus
- Basic Operators in Relational Algebra