0% found this document useful (0 votes)
41 views8 pages

Relational Algebra and Calculus Examples

The document provides an overview of relational algebra and relational calculus, focusing on their definitions and operations. It includes examples of unary operations, Cartesian products, unions, intersections, and various types of joins. Additionally, it explains tuple relational calculus and domain relational calculus with specific queries related to a student database.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views8 pages

Relational Algebra and Calculus Examples

The document provides an overview of relational algebra and relational calculus, focusing on their definitions and operations. It includes examples of unary operations, Cartesian products, unions, intersections, and various types of joins. Additionally, it explains tuple relational calculus and domain relational calculus with specific queries related to a student database.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

EXAMPLES OF RELATIONAL

ALGEBRA RELATIONAL
CALCULUS
NAME : [Link]
SUBJECT : DATABASE MANAGEMENT SYSTEMS
ROLL NO : 23B81A05L8
RELATIONAL ALGEBRA:

• Relational Algebra is a procedure query language i.e; it focuses on what to do


and how to do.

Student1 Table Student2


Table
UNARY OPERATIONS :

• Select the students from • Retrieve the names of


‘CSE’ department : students :
σDepartment=′CSE′​ πName​(STUDENT)
(STUDENT) Student Name
ID STUDENT
Name
YEARS Dept
Alice

Bob
101 Alice 20 CSE
Charlie
103 Charli 21 CSE
e
CARTESIAN PRODUCT : STUDENT * STUDENT
Difference ( - ) :
STUDENT2−STUDENT1

UNION ( ∪ ) : STUDENT1∪STUDENT2

Intersection ( ∩ ) : STUDENT1∩STUDENT2
INNER JOIN ( ⨝ ) :
STUDENT1⋈[Link]=[Link]​ • Right Outer Join ( ⟖ ) :
STUDENT2 STUDENT1 ⟖[Link]=[Link]​STUDENT2

Full Outer Join ( ⟗ ) :


Left Outer Join ( ⟕ ) : STUDENT1 ⟗[Link]=[Link]​STUDENT2
STUDENT1 ⟕[Link]=[Link]​STUDENT2
RELATIONAL CALCULUS :

• Tuple Relational Calculus (TRC) :


{t ∣ t∈STUDENT∧[Link]="CSE"}

Domain Relational Calculus (DRC) : {<ID,StudentName,Years,Dept> ∣ STUDENT(ID,StudentName,Years,Dept)∧ID>101}


THANK YOU

You might also like