Database design vs Application/UI  design, pls help..

Hi All,
I have to define a discoun that can be given on the combinations of the folllowing attributes : CustomerGroup, CustomerType, Customer, Region, District, Area, ProductGroup, ProductBrand, Product.
From the dba I get this table :
CREATE TABLE Promotions
(PromotionNo int NOT NULL,
PromotionName varchar(80) NOT NULL,
LimitAmount NUMBER(15,2) NOT NULL,
Status VARCHAR(15,2) NOT NULL,
Discount numeric(5,3) NOT NULL,
CustGroup int NULL,
CustType int NULL,
Customer int NULL,
Region int NULL,
District int NULL,
Area int NULL,
ProductGroup int NULL,
ProductBrand int NULL,
Product int NULL);
From the UI perspective, the requirement is to make data entry master-detail, with one master and three details like on this hierarchy :
PromotionMaster
(PromotionNo int,
PromotionName varchar(80),
LimitAmount NUMBER(15,2),
Status VARCHAR(15,2))
PromotionDetailByCustomer
(PromotionNo int ,
CustGroup int ,
CustType int ,
Customer int )
PromotionDetailByArea
(PromotionNo int ,
Region int ,
District int ,
Area int );
PromotionDetailByProduct
(PromotionNo int ,
ProductGroup int ,
ProductBrand int ,
Product int );
So here is the issue : To make the Promotions Table up to date, once the user press SAVE on the UI, the application must INSERT the following rows to the Promotions Table :
INSERT INTO Promotions
SELECT ..... FROM PromotionMaster JOIN
PromotionDetailByCustomer CROSS JOIN
PromotionDetailByArea CROSS JOIN
PromotionDetailByProduct
Is there any better approach than this ??
Thank you for your help,
xtanto

. Isn't it normalized ?In your previous post you said:
From the dba I get this table :
CREATE TABLE PromotionsThat table is not normalised.
Then I need a mechanism to make Cross Join from all details table to produce details
in PROMOTIONS table.Why? What purpose does that serve? If you already have actual tables representing
PromotionMaster, PromotionDetailByCustomer, PromotionDetailByArea and
PromotionDetailByProductthen the PROMOTIONS table is redundant. If you don't actually have those four tables in your database schema then that's bad. You should split the PROMOTIONS table into its constituent parts.
Why to make it easier for me to query which discounts a SalesOrder will get.If the PROMOTIONS table is intended to assist in this query then I think a table is the wrong answer. It is both an unnecessary waste of disk space and a A view would be better, although three views might be better still (one joining PromotionMaster with PromotionDetailByCustomer, one joining PromotionMaster with PromotionDetailByArea and one joining PromotionMaster with PromotionDetailByProduct). But I think the best of all would be a straight query on PromotionMaster with correlated sub-queries against PromotionDetailByCustomer, PromotionDetailByArea and PromotionDetailByProduct.
Still, without knowing more about the business rules and other sundry details (usage, table sizes, etc) it's difficult for me to be prescriptive.
Cheers, APC

Similar Messages

  • Database design for Help Desk application.

    Hello does any one know
    Database design for Help Desk application.
    ERD
    Business rules and features
    ?

    The best way to approach a database design is to write a
    specification for the application. Document what processes the help
    desk technicians will do. In the process, identify what pieces of
    information they work with. When you have the complete
    specification written, you can then begin grouping the pieces of
    information they work with together. For example, a ticket may have
    a number, status, priority and a person to whom it is assigned. The
    person to whom the ticket is assigned will have a name, phone
    number, e-mail address and a list of technical skills.
    So in this overly-simplified example, we could have a table
    that contains ticket information, a table that has information
    about technicians and a table of skills. Then ask your self
    questions like "Can one ticket be handled by more than one
    technician?" "Can one technician handle more than one ticket?" Can
    a technician have more than one skill?" In this way, you can begin
    seeing the one-to-one, one-to-many and many-to-many relationships
    that exist.

  • Hello all my 1.5 yr old imac has a screen getting drk from lower lft corner annd is creeping across screen apple care ended i paid 3500 for this machine and im a graphic designer pls help

    hello so i am a coolege student who saved for a decked out 27 inch imac for graphic design this was my first apple purchase ever 3500 bucks and the screen is slowly going b dark on lower left side to half way across screen i am broke and apple care is out is this really how long an apple lasts i cant get any help at all anyone know what to do or since jobs is gone is apple just garbage now?  anyone anyone

    I'd ask Apple to honor your expired apple care as this is a known issue with the 27" imac. I had the same problem with mine.
    And no... typically, macs last a long time. I have a mac book pro and an old swivel display; both are still working great. This seems to be a lots issue of bad parts.

  • Creation of database in WbDynpro application

    Hi ....
    i Want to know how to use database in WebDynpro Application.is anyone have help topic related to this?any simple Tutorial?...
    please help me..
    Thanks.

    The soultion is simple.All you need to do is establish connection .
    1. Create JDBC Datasource is VisualAdmin
    2. Write the following to create connection.
    public Connection getConnection() {
    try{
    Context ctx = new InitialContext();
    DataSource ds = (DataSource) ctx.lookup("jdbc/<<DataSourceName>>");
    con = ds.getConnection();
    return con;
    }catch(Exception e){
    return null;
    3. Use the above connection to get the resultset.
    Regards, Anilkumar

  • Urgent help database design

    Hi,
    I need an urgent help with the design of the database, We have already a database in production but we are facing a problem with extensibility.
    The client information is variant that is
    1) number of fields are different for each client
    2) client may ask anytime in future to add another field into the table
    Please provide your views with practical implication (advantages and disadvantages) or any resource where I can find information.....
    Help appreciated.....

    Hi,
    Database design is an art & science by itself - as far as I know, there aren't any rigid rules.
    I would suggest that you have a look at the discussions in these two threads for a few general ideas :
    Database Design
    conversion from number to character
    If your client requirements keep changing, I would suggest that you keep 8- 10 "spare" columns in your tables - just call them spare1, spare2, etc.. The only purpose of these tables is to allow flexibility in the design - i.e.., in future you can always extend the table to accommodate more fields.
    I have used it a couple of times & found it to be useful - again, this is only a suggestion.
    Regards,
    Sandeep

  • 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.

  • Help with a database design for community housing project

    Talking database design
    Hi all, I have been wondering about the design of tables for a big block of residential units. There are 100 + rooms. there are about 25 houses in this complex but the 100 + rooms are all rented out separately.
    Its just like a college campus really but its not a college campus , its a little unique.
    The rents are applied as a percentage of income, so thats not common, so I included a tblRoomCost where the pre-calculated weekly cost is entered, and its got a date field in there for when the change of rent charged. I probably need to include an income field in tblCustomer, even just as an Admin reference.
    So is this looking pretty ok and would there be any point in scrapping the database and using text files ?
    So what do you think of these tables please ?
    tblCustomer
    pkCustomer, fldFirstName, fldLastname
    tblRoomAllocation
    pkRoomID, fkCustomer
    tblRoomCost
    pkRoomID, fldDate, fldRoomCost
    tblTransactionID
    pkTransactionID, fldDate, fldTransactionType, fkCustomer, fldAmount

    The naming scheme is one I learned and havn't thought past it though I do get into trouble and your suggestion may prove useful when codeing !
    I thought the tblRoomAllocation and tblRoomCost took care of changing. Though I see now that tbleRoomAllocation needs a Date field really. And the tblRoomCost has a fldRoomCost which isnt really that good an implementation as the rooms themselves are priced always accoedijng to the income of a resident and not because of the room. So the real world object is getting fudgy........
    It is extremely unlikly that Admin would ever allow two rooms to be rented by an individual.
    I will have a look at possibly your suggestion that an Accounts table be used.
    Also I thought about having a startDate and EndDate in the tblTransaction to represent the period being paid for. Just seems like a lot of Dates in a transaction table. One to record the transaction, the other two dates to indicate the period that was actually being paid for. ? When perhaps I should work that out in the runtime code.v ? This will be a VB.Net app.
    Do you think there is a need for Accounts table if only one room is permitted to be rented , though room changing may be common?
    And thx for your input.
    Message was edited by:
    user521381

  • Re: (forte-users) Round-trip database design

    We have used Erwin quite sucessfully, but it's not cheap.
    "Rottier, Pascal" <Rottier.Pascalpmintl.ch> on 02/15/2001 04:51:01 AM
    To: 'Forte Users' <forte-userslists.xpedior.com>
    cc:
    Subject: (forte-users) Round-trip database design
    Hi,
    Maybe not 100% the right mailing list but it's worth a try.
    Does anyone use tools to automatically update the structure of an existing
    database?
    For example, you have a full database model (Power Designer) and you've
    created a script to create all these tables in a new and empty database.
    You've been using this database and filling tables with data for a while.
    Now you want to do some marginal modifications on these tables. Add a
    column, remove a column, rename a column, etc.
    Is there a way to automatically change the database without losing data and
    without having to do it manually (except the manual changes in the (Power
    Designer) model).
    Thanks
    Pascal Rottier
    Atos Origin Nederland (BAS/West End User Computing)
    Tel. +31 (0)10-2661223
    Fax. +31 (0)10-2661199
    E-mail: Pascal.Rottiernl.origin-it.com
    ++++++++++++++++++++++++++++
    Philip Morris (Afd. MIS)
    Tel. +31 (0)164-295149
    Fax. +31 (0)164-294444
    E-mail: Rottier.Pascalpmintl.ch
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

    Hello Pascal,
    Forte has classes which might be able to scan the database structure
    (DBColumnDesc,etc.). Express use this classes to determine how the
    BusinessClass looks like. We use Forte to create the tables,indexes and
    constraints. We have the Problem that the above described classes are only
    readable but not fillable. The solution for us will be to create our own
    classes in
    the same manner than existing classes are. So we are able to make updates in
    the database structure and maybe able to change the database tables with tool
    code. Another reason for us to have the database structure in the
    application is the
    ability to see the table structure on which the Forte code works always up
    to date
    with the code. You are always able to compare the structure of the database
    with
    your businessclasses and able to convert a wrong structure to the correct
    structure
    with maybe just a little piece of code.
    Hope this helps
    Joseph Mirwald

  • DataBase Design For InvoiceSystems

    Sir I am doing my Final Year B.sc(Comp.sci), I am having my Oracle Project to do things.
    I just wan't a Detailed DataBase Design for
    Invoice Systems
    Please Could you help me in terms of DataBase Design......

    The best way to approach a database design is to write a
    specification for the application. Document what processes the help
    desk technicians will do. In the process, identify what pieces of
    information they work with. When you have the complete
    specification written, you can then begin grouping the pieces of
    information they work with together. For example, a ticket may have
    a number, status, priority and a person to whom it is assigned. The
    person to whom the ticket is assigned will have a name, phone
    number, e-mail address and a list of technical skills.
    So in this overly-simplified example, we could have a table
    that contains ticket information, a table that has information
    about technicians and a table of skills. Then ask your self
    questions like "Can one ticket be handled by more than one
    technician?" "Can one technician handle more than one ticket?" Can
    a technician have more than one skill?" In this way, you can begin
    seeing the one-to-one, one-to-many and many-to-many relationships
    that exist.

  • Physical Database Design Steps & Performance Considerations

    Hi,
    We have a Oracle 9i install need help to create a DB.
    Required to know the Physical Database Design Steps & Performance Considerations.
    like
    1-Technical consideration of DB as per server capacity. how to calculate..?
    2- What will be the best design parameter for DB...?
    Can you please help how to do that. Any metalink ID help to get those information.
    thanks
    kishor

    there is SOOO much to consider . . . .
    Just a FEW things are . . .
    Hardware - What kind of Host is the database going to run on?
    CPU and Memory
    What kind of Storage
    What is the Network like?
    What is the database going to do OLTP or DW?
    Start with your NEEDS and work to fulfill those needs on the budget given.
    Since you say Physical Database Design . . . is your Logical Database Design done?
    Does it fulfill the need of your application?

  • Database design for DSS

    Hello All
    I have to design database for a DSS.
    It is basically a MIS project which will be used for reporting purposes
    Can anyone please tell me what are the considerations to be made
    while designing for such a system.
    Any documents or web links will be of great help
    Thanks in advance
    Ashwin N.

    The best way to approach a database design is to write a
    specification for the application. Document what processes the help
    desk technicians will do. In the process, identify what pieces of
    information they work with. When you have the complete
    specification written, you can then begin grouping the pieces of
    information they work with together. For example, a ticket may have
    a number, status, priority and a person to whom it is assigned. The
    person to whom the ticket is assigned will have a name, phone
    number, e-mail address and a list of technical skills.
    So in this overly-simplified example, we could have a table
    that contains ticket information, a table that has information
    about technicians and a table of skills. Then ask your self
    questions like "Can one ticket be handled by more than one
    technician?" "Can one technician handle more than one ticket?" Can
    a technician have more than one skill?" In this way, you can begin
    seeing the one-to-one, one-to-many and many-to-many relationships
    that exist.

  • Why would you need a database design before implementing?

    Why would you need a database design before implementing?

    977222 wrote:
    Why would you need a database design before implementing?It appears from the 4 questions you put up ina 2 hour period
    help me with this
    Why would you need a database design before implementing?
    Re: answer these quesions pls
    answer these quesions pls
    That you have put off doing your homework and now expect this forum of volunteers to do your research for you ....

  • Requirements for database design and installation

    Hi,
    As a database administrator, how to find out whether the database is design and installed properly?
    Can you please what would be the requirements to be considered towards the databse design for application developer ?
    thanks heaps !!!!

    Mohamed ELAzab wrote:
    regarding that the number of execution is the main thing that affects the performance i said that already above " the application executed it 30 000" but you didn't read my answer correctly. I did not respond to that "answer" of yours as it was not part of your posting that I responded too. In your response, which I quoted, talked about non-sharable SQL retrieving 20 rows and after 3 years it retrieving a million rows. This has no bearing on whether the SQL is sharable or not.
    I don't agree with you regarding that the design is not being done regarding considering the performance bottlenecks.So you decide on what the bottlenecks are up front, and then use these as database design considerations? I fail to see any logic or merit in such an approach.
    i want to let you know that we in the telecoms environment have many problems in our databases because the people who designed those applications didn't take performance in consideration.I understand too well - and it is not that they did not take performance into consideration when designing the database, it is because the design is just plain wrong from the start.
    You do not need to consider amount of memory available, number and speed of CPUs, bandwidth and speed of the I/O system, in order to design a database. These have no relevance at all during the design phase. Especially as the h/w that will run the design in production in a year's time can be drastically different from the h/w that will be used today.
    No, instead you use a proper and correct design methodology and data modeling approach. Why? Because such a design by its very nature will make optimal use of h/w resources and will provide data integrity, scalability and performance.
    Again i think design of the database application must take database performance bottlenecks in consideration like application which doesn't use bind variables if they took into consideration to avoid that it will help the DBA in the future but unfortunately most people doesn't do that. And as I said - using bind variables or not has absolutely nothing to do with the basic question asked in this thread: "+what are the requirements of database design+".
    How does using/not using bind variables influence the design of a table? Determine whether an entity is in 3NF? What the unique identidiers are for an entity? These are the design considerations for a database.. not bind variables.
    Yes, SQLs not using bind variables can cause performance problems. Not paying the electricity bill can cause a power outage for the database server. So what? These issues have no relevance to database design.

  • Is ADF meant for database designed with vertical schema ?

    Hi,
    I want to know if ADF 11g is meant for database designed with vertical schema where even the column names will be rows in a generic table?
    Thanks in advance.
    Edited by: user8925296 on Apr 12, 2010 10:06 AM

    The short answer is no...
    What you are calling a "vertical schema" is what others have called an entity-attribute-value or universal data model schema. I'd advise you to do some open-minded research about these types of schemas if you are developing a new application before you proceed. They sound great in practice, but have quite inherent usability and scalability issues. [url http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2314483800346542969]This might be a good place to start...
    John

  • DataBase Design For Inventory Systems

    Sir I am doing my Final Year B.sc(Comp.sci), I am having my Oracle Project to do things.
    I just wan't a Detailed DataBase Design for
    Inventory Systems
    Please Could you help me in terms of DataBase Design......

    The best way to approach a database design is to write a
    specification for the application. Document what processes the help
    desk technicians will do. In the process, identify what pieces of
    information they work with. When you have the complete
    specification written, you can then begin grouping the pieces of
    information they work with together. For example, a ticket may have
    a number, status, priority and a person to whom it is assigned. The
    person to whom the ticket is assigned will have a name, phone
    number, e-mail address and a list of technical skills.
    So in this overly-simplified example, we could have a table
    that contains ticket information, a table that has information
    about technicians and a table of skills. Then ask your self
    questions like "Can one ticket be handled by more than one
    technician?" "Can one technician handle more than one ticket?" Can
    a technician have more than one skill?" In this way, you can begin
    seeing the one-to-one, one-to-many and many-to-many relationships
    that exist.

Maybe you are looking for

  • Xml conversion of data refs with dynamic type

    Hi Colleagues, I have to create an XML from a TYPE REF TO DATA, where this data is created using a dynamic internal table. By dynamic internal table i mean that the internal table is created dynamically using the class method cl_alv_table_create=>cre

  • Ipad as a gift to family in Cyprus.  Will it work?

    Do I need to buy the 3G?  If so will they be able to use a local carrier?

  • Details in the elements section

    Can I print the details of the elements section?

  • What is the "Linksys Wireless G Home Router (N90123)"?

    I found that on BestBuy's website, but I can not find useful information about this router on google. Is there another name for this product ? http://www.bestbuy.ca/catalog/proddetail.asp?sku_id=0926INGFS10097712&catid=21119&logon=&langid=EN Message

  • Server won't start and JAR files

    My application uses external classes (quartz, jersey, jackson) and I included all the jar files containing the external classes in the WEB-INF\lib directory of the EAR file already. I deployed it to WLS 10.3.5 on windows but when I tried to start it