Re: Re: [LIP] An SQL question about using multiple tables

Sandip Bhattacharya <[email protected]> Thu, 9 Sep 2004 10:16:21 +0530
Newsgroups gmane.user-groups.linux.delhi.devel,gmane.user-groups.linux.india.programmers
Organization Puroga Technologies Pvt. Ltd.
Message-ID <[email protected]>
On Thursday 09 Sep 2004 10:11 am, Pankaj Kaushal wrote:
>
> for example,
> SELECT ... FROM a,b,c,d,e WHERE a.id=b.id AND a.id=c.id AND a.id=d.id
> AND a.id=e.id and then you can do a DISTINCT (a.id) or whatever


There is no c.id, d.id .... there are no primary keys in b,c,d.

Think of A(aid, aname, aaddress) as a table of people. And B a table of 
languages that the person speaks. Assume there is a table 
LANG(langid,langname). Then B has the structure (aid, langid), and for every 
aid, there can be multiple rows in B.

Similarly, C,D are other table of attributes for the persons in A.

The search criteria specifies a particular combination of all attributes, so 
the criteria is definitely an AND.

- Sandip

-- 
Sandip Bhattacharya    *    Puroga Technologies   *     sandip-/[email protected]
Work: http://www.puroga.com        *         Home: http://www.sandipb.net

PGP/GPG Signature: 51A4 6C57 4BC6 8C82 6A65 AE78 B1A1 2280 A129 0FF3

Neutrinos have bad breadth.