How is the design for this complex requirement ?

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

How was your wife using the Find My iPhone app from a Samsung phone? But, that question aside, your wife should educate herself on how GPS works, especially on a cell phone. GPS signals can be interfered with by trees, buildings, clouds. Off by several miles would be unusual, though.
If your wife is tracking your cell phone and not believing what you tell her, you may want to consider counseling as there are some very serious issues that go way beyond the technology.
Best of luck.

Similar Messages

  • How is the design for this complex requirement ? pls help..

    Hi All,
    We have a Discount scheme that can be given for all possible
    combination of all customer, area and product hierarchy (attached below).
    for example :
    Promotion No.001 =>for sales on : CustomerGroup 'A', Area 'B', and
    ProductBrand 'C' will get discount 2 %
    Promotion No.002 =>for sales on : AllCustomer, District 'D', and
    Product 'E' will get discount 2.5 %
    Promotion No.003 =>for sales on : CustomerType 'F', AllArea, and
    ProductGroup 'G' will get discount 3 %
    ... and any possible combination.
    And it is possible for an Order / Invoice to get discount from two or
    more different promotion.
    e.g: Order 001, get 2 % from Promotion No.001 and 3 % from Promotion
    No.003, so totally it gets 5% discount.
    (1) Customer Hierarchy
    AllCustomer
    CustomerGroup
    CustomerType
    Customer
    (2) Area Hierarchy
    AllArea
    Region
    District
    Area
    (3) Product Hierarchy
    AllProduct
    ProductGroup
    ProductBrand
    Product
    Our Orders Data has following attributes :
    OrderNo.
    Customer
    Area
    Product
    Gross
    Discount
    Additional info :
    - Oracle version : 10g
    - If multiple discounts are applied, e.g: two discount, 10% each, then
    the total discount is 20%, if gross = 100, then netto is 100 * 80% =
    80.
    The design that comes to my mind is like below, please give me
    correcttion and recommendation :
    The Promotions is defined in master-detail :
    - one master table
    - three detail tables (one for each possible hierarchy)
    - one additional Tabel to store detail of discount an Order get,
    because it can get 2 or more discount.
    PromoHeader :
    - PromoNumber
    - Description
    - StartDate
    PromoDetail1 :
    - PromoNumber
    - PType (ALL / CustomerGroup / CustomerType / Customer)
    - PCode (ALL / 'xxxx' )
    ( note : 'xxxx' can be Customer Group Code, Customer Type Code or
    Customer Code )
    PromoDetail2 :
    - PromoNumber
    - PType (ALL / Region / District / Area)
    - PCode (ALL / 'xxxx' )
    ( note : 'xxxx' can be Region Code, District Code or Area Code )
    PromoDetail3 :
    - PromoNumber
    - PType (ALL / ProductGroup / ProductBrand / Product)
    - PCode (ALL / 'xxxx' )
    ( note : 'xxxx' can be ProductGroup Code, ProductBrand Code, Product
    Code )
    PromoByOrder
    - OrderNumber
    - PromoNumber
    - PType
    - PCode
    - Discount (%)
    (if an Order get two discount, there will be two records on this table
    for thet order)
    The question is :
    1) is this a 'good enough' design ?
    2) if I do go with this design, how is the efficient query / plsql to
    calculate the discounts for an Order.
    Pls help..
    Thank you very much,
    xtanto

    How was your wife using the Find My iPhone app from a Samsung phone? But, that question aside, your wife should educate herself on how GPS works, especially on a cell phone. GPS signals can be interfered with by trees, buildings, clouds. Off by several miles would be unusual, though.
    If your wife is tracking your cell phone and not believing what you tell her, you may want to consider counseling as there are some very serious issues that go way beyond the technology.
    Best of luck.

  • My wife was looking for me last Friday morning with the app find my phone.  The app showed that I was not where I said I was and she does not believe me.  How is the explanation for this mistake, I know where I was at but she is very upset.

    Please help!!! My wife has a Samsung galaxy 4s, and she was looking for me last Friday (09/19/2014) morning with the find my phone app.  I have a iPhone 5S and the app placed me in a location about 5 or 6 miles away from where I was actually at.  My wife if very up set and thinks I am lying to her.  Is there a way to get here the proper information so she does not have to feel like I am a lier.  This is a big problem and I need help. I can get video but it is very  expensive and takes a court order. I truly need help with this I have kids and this is problem is destroying our marriage.
    Thanks
    Greg Soileau

    How was your wife using the Find My iPhone app from a Samsung phone? But, that question aside, your wife should educate herself on how GPS works, especially on a cell phone. GPS signals can be interfered with by trees, buildings, clouds. Off by several miles would be unusual, though.
    If your wife is tracking your cell phone and not believing what you tell her, you may want to consider counseling as there are some very serious issues that go way beyond the technology.
    Best of luck.

  • Pls give me the solution for this requirement

    Hi experts ,
    pls give me the solution for this requirement
    what we have to do when basis guys are tranported my object to the production without completting . how can we rectiify this .
    thanks in advance

    Hi
    After Transporting a request or released a request you cant do any thing in that so now you have to create a new Transport request for your report continue with that. After completion transport it . It will makes no difference it will just over write already existing report
    Reward alll helpfull answers
    Regards
    Pavan

  • How the files are decreasing from RBS storage after some time i delete docs from document library, where shld I check the settings for this?

    HI
    I created a web application and configured  rbs storage ,
    I uploaded documents (for ex: 18 number)
     after uploaded  documents ,  and observed the RBS storage folder, number of files are increasing (39 number) , its working fine
    and also  I run the querys to check the rows increasing or not , (when I upload new doc rows are increased its fine also)
    select count(*) from alldocs
    Select count(*) from AllDocstreams
    but when I delete some docs from document library ,
    1)the doc itself deleted from document library
    2)when I check the rbs storage  there is no number of files are decreased(its still 39 files ), its same as  before doc deleted from doc library
    after some time I found the number of files are decreasing from RBS storage folder in sql server,
    here I want to know the how the files are decreasing from RBS storage  after some time, where  shld I check the settings for this? and how I control on it
    here how I know the settings for cleaning up orphan BLBOS how  these deleted BLOB
    adil

    1. WHen you delete the file from Sharepoint, it is still present in Recycle bin. This is a default setting in sharepoint for 30 days. Once files are deleted fro Recycle bin, it can also be delete from RBS
    2. There is a RBS cleanup job which deletes files from RBS. for more info check 
    http://mehuljamod.blogspot.in/2012/09/remote-blob-storage-maintainer-rbs.html

  • HT203052 How do I delete an icloud account which uses an email account no longer in use - I do not have the the passwrd for this account

    How do I delete an icloud account which uses an email account no longer in use - I do not have the the passwrd for this account

    You will need the password. If you can't get it reset via http://iforgot.apple.com (if you remember the answers to the account's security questions then you should be able to reset it via them) then try contacting Support in your country, they should be able to reset it.
    Contacting Apple about account security : http://support.apple.com/kb/HT569
    If your country isn't on that page then try this form and explain and see what they reply with : https://ssl.apple.com/emea/support/itunes/contact.html

  • My macbook keeps asking me to use an administrator and their password to continue but nobody seems to know who is the administrator for this computer...does anyone know how to avoid this this or figure out who the administrator is?

    My macbook keeps asking me to use an administrator and their password to continue but nobody seems to know who is the administrator for this computer...does anyone know how to avoid this this or figure out who the administrator is?

    Lynne130,
    to figure out which users have administrative privileges, open the Users & Groups pane of System Preferences; each user other than the Guest User will be shown with a description of either “Admin” or “Standard”. It’s typical for the first user created on a Mac to be an administrative user.

  • I have purchased a in app purchase of a 'gcsepod' for my little brother however the purchase does not come up in the app and requests me to buy another. How do i solve this? I have also got the receipt for this purchase.

    i have purchased a in app purchase of a 'gcsepod' for my little brother however the purchase does not come up in the app and requests me to buy another. How do i solve this? I have also got the receipt for this purchase.

    I'm not sure I can make sense of this but without asking too many questions, you can resolve your question by contacting iTunes direct.
    Apple - Support - iTunes - Contact Us
    But they will be wondering about the reference to hacking and you feeling bad about getting something for free.
    Best step in my view is to make sure you don't get similarly involved in future.  You must know roughly what you were doing.   Then writie it off to a not to be repeated experience.

  • How to resolve error message "iTunes could not back up the iPhone because the backup was corrupt or not compatible with the iPhone. Delete the backup for this iPhone, then try again."

    I inadvertently deleted my iPhone backup on my MacBook Pro. I restored iPhone to factory settings and then synced remotely with iCloud. However the error message repeatedly states:
    iTunes could not back up the iPhone because the backup was corrupt or not compatible with the iPhone. Delete the backup for this iPhone, then try again.
    Any ideas as to how this can be resolved please. Thank you very much.

    My wife's iPhone 5 would not backup, after upgrading to iOS 8.     The "genius" at the Apple store succeeded in DELETING, the only recent backup of her phone so
    recovery became more critical.
    I followed all the procedures for troubleshooting it, but still it would try to backup and then stop due to an error. We particularly wanted to preserve some game data/history/progress that she'd been working on for years.      This game (Dream Fish) would no longer open after the iOS 8 upgrade ... and the phone would not successfully backup, and so we had no confidence that it would restore from an older backup either.       I googled for solution and found Phoneview and iFunBox.      These apps allow you to see & access data files in the iPhone.      Phoneview was too fragile and crashed when copying a file any size.     
    I found "iFunBox".     iFunBox was excellent.      I used iFunBox to recover her game data.    It allows you to make a copy of data files that reside on the iPhone... and store them as a manual backup on the Mac.
    And in the process I found 2 games that caused iFunBox to crash.      The 2 games in question were not important enough to try to keep, so I deleted them from the iPhone.
    So then, I had a manual backup of the important iPhone data, and had eliminated two game files that apparently had a conflict with iOS 8.
    My next Backup attempt was successful.        The iPhone with iOS 8 would now backup to both the Mac and to the Cloud.
    Next I deleted Dream Fish from the iPhone and downloaded a fresh version from the Cloud.    The new Dream Fish with no history opened in iOS 8.
    Then I used iFunBox to copy my wife's Dream Fish data history from the Mac back into the new game.
    Once the transfer was complete, Dream Fish would now OPEN and all of her progress was there and working like normal.
    Hope this helps.

  • HT1766 Error message: "iTunes could not back up the iPhone because the backup was corrupt or not compatible with the iPhone.  Delete the backup for this iPhone, then try again." But how do I delete the backup?

    Error message when attempting to backup up iPhone4S to Mac says "iTunes could not back up the iphone because the backup was corrupt or not compatible with the iPhone.  Delete the backup for this iPhone, then try again." But how do I delete the backup? Can't find answer to that anywhere.

    We had this problem after upgrading to iOS 8.       The iPhone 5 would not backup either to the cloud or to the computer.   Backup always ended with an error message.
    Long story short, with the help of iFunBox ( which I used to make manual backups of some important iPhone data files ), I discovered two games that
    would crash iFunBox.      They were not important games for us, so I didn't try to isolate the offending data files.     And I deleted the two games from the iPhone.
    Apparently these two games conflicted with iOS 8 just as they did with iFunBox.      The next backup without those games was then successful.
    I backed up to both the Mac and the cloud.
    Hope this helps.

  • I just got my refurb iPad in the mail. I am trying to set it up, but im getting this message "iTunes could not back up the ipad because the backup was corrupt or not compatable with the ipad. Delete the backup for this ipad. then try again." How?

    I just got my refurb iPad in the mail. I am trying to set it up, but i am getting this error message " iTunes could not back up the ipad because the backup was corrupt or not compatable with the ipad. Delete the backup for this ipad. Then try agian." How do I do that?

    It sounds like the iPad wasn't erased to me. If the iPad is totally cleared of content, there should be nothing on it and no backup to create.
    Without connecting the iPad to your computer - Launch iTunes on you computer and go to Edit>Prefences>Devices. Do you see an iPad backup in there? If you do see it, delete it.

  • I am a student who subscribed to the 9.99 photography package, I didn't realize there was a discount for students.  I would like to upgrade to the full package with the student discount.  I can not find the option for this. How do I do this?

    I am a student who subscribed to the 9.99 photography package, I didn't realize there was a discount for students.  I would like to upgrade to the full package with the student discount.  I can not find the option for this. How do I do this?

    Hi Djmontanalv,
    Please go through the link below.
    http://helpx.adobe.com/x-productkb/policy-pricing/cancel-membership-subscription.html
    Regards,
    Anand

  • HT201441 Hi I bought a second-hand phone iphone4, I update the software when you want to activate the phone asked for my registration icloud I do not know what is the password for this registration, can you tell me how to go to the next step without such

    Hi I bought a second-hand phone iphone4, I update the software when you want to activate the phone asked for my registration icloud I do not know what is the password for this registration, can you tell me how to go to the next step without such registration in icloud
    my ICCID is 8935905000307066111

    Unfortunately, you cannot do very much with your phone unless you get assistance from the previous owner, they should either provide you with the password to unlock it or remove their account from the phone entirely remotely through iCloud.com > Find My Phone.

  • How do you set the time for this forum??? Not in nerd pleas

    how do you set the time for this forum?

    There were problems with the correct time display for postings, and based on another recent post this doesn't seem to have been fixed. My advice... don't worry about it.

  • I have uninstalled and reinstalled iTunes multiple times.  When I connect my iPod Classic I get the following message:  The software for this iPod is not installed correctly.  Please reinstall iTunes to install the required software.  Any ideas?

    I have uninstalled and reinstalled iTunes multiple times.  When I connect my iPod Classic I get the following message:  The software for this iPod is not installed correctly.  Please reinstall iTunes to install the required software.  Any ideas?

    Assuming you have windows, try uninstalling iTunes and all of its components as by following this guide exactly: Windows XP or Windows Vista/7, then reinstall iTunes.  You must follow this guide exactly or it will not be successful.  Note: uninstalling iTunes will only remove the application; it will not touch your iTunes library or data.

Maybe you are looking for