
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Rename 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).
Rename operation
It is used to assign a new name to a relation and is denoted by ρ (rho).
Syntax
ρnewname (tablename or expression)
Consider the student table given below −
Regno | Branch | Section |
---|---|---|
1 | CSE | A |
2 | ECE | B |
3 | CIVIL | B |
4 | IT | A |
Example 1
The student table is renamed with newstudent with the help of the following command −
ρnewstudent (student)
Example 2
The name, branch column of student table are renamed and newbranch respectively
ρnewname,newbranch(∏name,branch( student))
Binary operations are applied on two compatible relations.
Two relations R1, R2 are to be compatible if they are of the same degree and the domains of corresponding attributes are the same.
The Rho in DDL used for name of relation and in DML used for name of attributes.
SQL Old name New name
Types of RENAME
Renaming can be used by three methods, which are as follows −
Changing name of the relation.
Changing name of the attribute.
Changing both.