Re: Join issue

From: <operationsengineer1(at)yahoo(dot)com>
To: Burak Seydioglu <buraks78(at)gmail(dot)com>, Michael Glaesemann <grzm(at)seespotcode(dot)net>
Cc: ken(at)scottshill(dot)com, operationsengineer1(at)yahoo(dot)com, pgsql-sql(at)postgresql(dot)org
Subject: Re: Join issue
Date: 2006-06-07 19:04:23
Message-ID: 20060607190423.67115.qmail@web33305.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Table structures:
>
> ce_house
> ====================
> house_id
> provider_id
>
> ce_contract
> ====================
> contract_id
> house_id
> contract_term
> contract_created
>
> ce_contract_status
> ====================
> contract_status_id
> contract_id
> contract_status
> contract_status_created
>
> ce_provider
> ====================
> provider_id
> provider_name
>
> ce_provider_rate
> ====================
> provider_rate_id
> provider_id
> provider_rate_amount
> provider_rate_created

if i'm reading this right, a house can only have one
provider, but a house can have multiple contracts. at
first glance, i'd think the contracts should be
associated with the provider, not the house. if true,
you need to update your table structure.

is the rate associated with the contract (i'd assume
so with limited informationthink so) or the provider
(the way you have it set up)?

this is how i envision the table structure (granted, i
have limited information so i coul dbe way off
base)...

ce_house
====================
house_id

ce_provider
====================
provider_id
** house_id (fkey) **
provider_name

ce_contract
====================
contract_id
** provider_id (fkey) **
contract_term
contract_created

ce_contract_status
====================
contract_status_id
contract_id (fkey)
contract_status
contract_status_created

** ce_contract_rate **
====================
contract_rate_id
contract_id (fkey)
contract_rate_amount
contract_rate_created

i also assume, based on your structure, that you can
have multiple contract statuses for a given contract.
if not,you could probably delete that table and just
add contract_status and contract_status_created to
ce_contract.

i'm sorry if i'm way off base, but i'm trying to wrap
my head around the table strcuture, but i'm not
necessarily familiar with all the business rules that
created the structure - so i may be way off base here.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message operationsengineer1 2006-06-07 19:25:15 Re: How To Exclude True Values
Previous Message Burak Seydioglu 2006-06-07 17:51:27 Re: Join issue