Re: relational algebra - semi joins

From: code_wrong <tac_at_tac.ouch.co.uk>
Date: Sun, 16 May 2004 23:40:36 +0100
Message-Id: <1084747115.10526.0_at_eunomia.uk.clara.net>


"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 Mon May 17 2004 - 00:40:36 CEST

Original text of this message