Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: (Revised) How is the design for this complex requirement ?

Re: (Revised) How is the design for this complex requirement ?

From: DA Morgan <damorgan_at_psoug.org>
Date: Fri, 01 Sep 2006 10:55:24 -0700
Message-ID: <1157133322.75419@bubbleator.drizzle.com>


krislioe_at_gmail.com wrote:
> Hi All,
>
> I have Customer hierarchy as follow :
> CustomerCategory
> CustomerType
> CustomerGroup
> Customer
>
> Discount can be given to a CustomerCategory, or CustomerType, or a
> CustomerGroup, or a Customer , or to ALL Customer. Discount is defined
> in a Promotion Table
>
> Customer Table :
> CustomerCode
> CustomerName
> CustomerCategoryCode
> CustomerTypeCode
> CustomerGroupCode
>
> Order Table :
> OrderNo
> OrderDate
> CustomerCode
> OrderGross
> Discount
>
> Promotion Table :
> PromoNumber
> PromoType (ALL / CustomerCategory / CustomerGroup / CustomerType /
> Customer)
> PCode (ALL / 'xxxx' )
> Discount
> ** note :
> if PromoType = PCode = 'ALL', means the Discount is given to all
> customer.
> If PromoType = 'CustomerCategory' then PCode = Customer
> Category Code
> If PromoType = 'Customer' then PCode = Customer Code
> and so on...
> ** by doing this I avoid to define discount in four table.
>
> The question is :
>
> 1) Is there any better way to define the promotion table
>
> 2) If I do design the Promotion table like above, how is the efficient
> query to find the discount for an Order ??
>
> Thank you for your help,
> xtanto

The answer is yes.
Why did you ignore the advice already received? Please see your manager about getting you the training you need.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Fri Sep 01 2006 - 12:55:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US