- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Explain cartesian product 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
Union, intersection, difference, cartesian, join, division comes under binary operation (operate on two tables).
Cartesian product operation
It combines R1 and R2 without any condition. It is denoted by X.
Degree of R1 XR2 = degree of R1 + degree of R2
{degree = total no of columns}
Example
Consider R1 table −
RegNo | Branch | Section |
---|---|---|
1 | CSE | A |
2 | ECE | B |
3 | CIVIL | A |
4 | IT | B |
Table R2
Name | RegNo |
---|---|
Bhanu | 2 |
Priya | 4 |
R1 X R2
RegNo | Branch | Section | Name | RegNo |
---|---|---|---|---|
1 | CSE | A | Bhanu | 2 |
1 | CSE | A | Priya | 4 |
2 | ECE | B | Bhanu | 2 |
2 | ECE | B | Priya | 4 |
3 | CIVIL | A | Bhanu | 2 |
3 | CIVIL | A | Priya | 4 |
4 | IT | B | Bhanu | 2 |
4 | IT | B | Priya | 4 |
- Related Articles
- Explain the relational algebra in DBMS?
- 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 select operation in relational algebra (DBMS)?
- Explain the binary operations in relational algebra (DBMS)?
- Explain the evaluation of relational algebra expression(DBMS)
- What is join operation in relational algebra (DBMS)?
- Write queries using aggregate functions in relational algebra (DBMS)?
- Explain the Relational Model in DBMS?
- Difference between Relational Algebra and Relational Calculus
- Basic Operators in Relational Algebra
- Explain the unary operations of algebra relations in DBMS?
