| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: relational algebra - semi joins
"code_wrong" <tac_at_tac.ouch.co.uk> wrote in message
news:1084741452.6632.0_at_eunomia.uk.clara.net...
> Hi,
> consider 2 relations/tables
> Employees and Depts (departments)
> Each Dept has one or many Employees
> Each Employee has one Dept only
> Employees has a foreign key into Depts.
>
> Now if we use a right semi-join
> the resulting table will be a list of the records
> in Depts where there is one or many Employees in the
> Employees table.
>
> My questions is this:
> If there are more than one employees in a department
> does the result of the semi join have duplicate records
> ???
>
> ie
> Dept#, dept_name
> 1 torturing
> 1 torturing
> 2 accounts
>
> (The torturing department has two employees)
ok the answer to my question seems to be NO.
SELECT Dept#, dept_name FROM Depts
WHERE Depts.Dept# = Employees.Dept#;
Received on Sun May 16 2004 - 17:40:36 CDT
![]() |
![]() |