Oops! It appears that you have disabled your Javascript. In order for you to see this page as it is meant to appear, we ask that you please re-enable your Javascript!

Semi Join with Examples in Relational Algebra, Database Systems

Semi-Join with Examples in Relational Algebra (Database Systems)

Today, in this fresh and new article, we will cover the following topics;

  1. What is Semi Join?
  2. Examples of Semi Join

What is Semi Join?

Semi-Join matches the rows of two relations and then show the matching rows of the relation whose name is mentioned to the left side of ⋉ Semi Join operator. I am describing the more details in the below examples. Hopefully, it will help you to understand the semi-join.

Example 1 of Semi Join

IDRankSalary
101Assistant Professor80,000
102Associate Professor90,000
103Lecturer70,000

Table 1: Teacher

IDRollNoMarks
1032017 – 0180
1042017 – 0290
1052017 – 0370

Table 2: Student

IDRollNoMarks
1032017 – 0180

Table 3: Student ⋉ Teacher OR Student Semi Join Teacher

IDRankSalary
103Lecturer70,000

Table 4: Teacher ⋉ Student OR Teacher SEMI-JOIN Student

Example 2 of Semi Join

IDRankSalary
101Assistant Professor80,000
102Associate Professor90,000
103Lecturer70,000

Table 5: Teacher

IDRollNoMarks
1012017 – 0180
1032017 – 0290
1062017 – 0370

Table 6: Student

IDRollNoMarks
1012017 – 0180
1032017 – 0290

Table 7: Student ⋉ Teacher OR Student SEMI-JOIN Teacher:

IDRankSalary
101Assistant Professor80,000
103Lecturer70,000

Table 8: Teacher ⋉ Student OR Teacher SEMI-JOIN Student

Example 3 of Semi Join

Employee
NameEmpIdDeptName
Sameed1CS
Shahzeb2SE
Abid3CS
Shamil4IT
Department
DeptNameManager
SEShahzeb
ITShamil
Employee  Dept
NameEmpIdDeptName
Shahzeb2SE
Shamil4IT

Topic Covered

Semi-Join with Examples in Relational Algebra, Database Systems.