Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #1872

Re: Sql question

From Lennart Jonsson <erik.lennart.jonsson@gmail.com>
Newsgroups comp.databases.ms-sqlserver
Subject Re: Sql question
Date 2015-02-02 08:45 +0100
Organization A noiseless patient Spider
Message-ID <man9t2$mk3$1@dont-email.me> (permalink)
References <mafpue$d3c$1@dont-email.me> <magl5q$cfh$1@dont-email.me> <1f5aad6b-a99e-48c3-adde-5f72eea5793b@googlegroups.com>

Show all headers | View raw


On 2015-02-02 07:16, rja.carnegie@gmail.com wrote:
[...]
> I wonder if you need to write the statement as a JOIN
> given that we know we're interested in "wives" of
> employee id = 3.  Why not just:
>
> SELECT * FROM Employee WHERE EmpPartner = 3;
>

Yes, good observation


> This is a strange problem in many ways.  One database
> seems to contain multiple firms and their employees,
> and the tax authorities get to use it as well?
> And it's implied that any possible wife is recorded
> in the employee table?
>

Agreed


[...]

>
> Enforcement would meant that only one Employee -
> one wife - can have EmpPartner = 3.
>
> I'm not sure how to write that rule.
>

UNIQUE ( EmpPartner );


> Anyway, maybe the database designer anticipated
> legal polygamy if Mitt Romney had won.
>

:-)

[...]

Back to comp.databases.ms-sqlserver | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Sql question "Tony Johansson" <johansson.andersson@telia.com> - 2015-01-30 12:29 +0100
  Re: Sql question Lennart Jonsson <erik.lennart.jonsson@gmail.com> - 2015-01-30 20:14 +0100
    Re: Sql question rja.carnegie@gmail.com - 2015-02-01 22:16 -0800
      Re: Sql question Lennart Jonsson <erik.lennart.jonsson@gmail.com> - 2015-02-02 08:45 +0100
      Re: Sql question "Tony Johansson" <johansson.andersson@telia.com> - 2015-02-03 01:06 +0100
        Re: Sql question rja.carnegie@gmail.com - 2015-02-03 09:06 -0800

csiph-web