Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Relational algebra
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Semijoin === The left semijoin (β and β) is a joining similar to the natural join and written as <math alt="π β π">R \ltimes S</math> where <math alt="π ">R</math> and <math alt="π">S</math> are [[relation (database)|relation]]s.{{efn|In [[Unicode]], the ltimes symbol is β (U+22C9). The rtimes symbol is β (U+22CA)}} The result is the set of all tuples in <math alt="π ">R</math> for which there is a tuple in <math alt="π">S</math> that is equal on their common attribute names. The difference from a natural join is that other columns of <math alt="π">S</math> do not appear. For example, consider the tables ''Employee'' and ''Dept'' and their semijoin:{{citation needed|date=April 2022}} {{col-begin|width=auto; margin:0.5em auto}} {{col-break}} {| class="wikitable" |+ ''Employee'' |- ! Name !! EmpId !! DeptName |- | Harry || 3415 || Finance |- | Sally || 2241 || Sales |- | George || 3401 || Finance |- | Harriet || 2202 || Production |} {{col-break|gap=2em}} {| class="wikitable" |+ ''Dept'' |- ! DeptName !! Manager |- | Sales || Sally |- | Production|| Harriet |} {{col-break|gap=2em}} {| class="wikitable" |+ ''Employee'' β ''Dept'' |- ! Name !! EmpId !! DeptName |- | Sally || 2241 || Sales |- | Harriet || 2202 || Production |} {{col-end}} More formally the semantics of the semijoin can be defined as follows: <math alt="π β π = { π‘ : π‘ β π β§β β π β π(Fun(π‘ β© π ))}">R \ltimes S = \{ t : t \in R \land \exists s \in S(\operatorname{Fun}(t \cup s)) \}</math> where <math alt="Fun(π)">\operatorname{Fun}(r)</math> is as in the definition of natural join. The semijoin can be simulated using the natural join as follows. If <math alt="aβ, β¦, aβ">a_1, \ldots, a_n</math> are the attribute names of <math alt="π ">R</math>, then <math alt="π β π = Ξ _{aβ, β¦, aβ} (π β π)">R \ltimes S = \Pi_{a_1, \ldots, a_n}(R \bowtie S).</math> Since we can simulate the natural join with the basic operators it follows that this also holds for the semijoin. In Codd's 1970 paper, semijoin is called restriction.<ref name="Codd1970" />
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Relational algebra
(section)
Add topic