1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Displaying th emean and variance of purchased items

Discussion in 'JSP' started by chickenyd, Mar 12, 2006.

  1. chickenyd

    chickenyd New Member

    Joined:
    Mar 11, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    0
    Hi

    i am trying to create a program using WML, WMLSCRIPT, AND JSP. The task is to create a website to be displayed in the WAP Browser. In the website for a company called 'BargainBook' that sells books and the ERD diagram for this is attached as picture (see attachement).

    So now I have just finished creating a login and register page and nearly done on purchase page BUT what I want to do is to find out how to display the MEAN and VARIANCE of purchased books in a given period of time (let say 1 week for example) . Plus how can I extend my ER Diagram in order to add this because I think I may need a separate entity (or table) for this.

    Any explanation will be very much appreciated. As I said I think need a new table for this BUT I do not know what kind of record should be stored on it that would help with the calculation. And also, I would like to know the suitable SQL queries to calculate the mean and variance for a given period of time.



    thanks
     
  2. chickenyd

    chickenyd New Member

    Joined:
    Mar 11, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    0
    Sorry Here Is The Attachment Erd

    Sorry I Forgot To Put The Erd Before. Here It Is..
     

    Attached Files:

  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,276
    Likes Received:
    364
    Trophy Points:
    83
    You need to store the "order time" and calculate the mean/variance based on the time frame a report demands.
     
  4. coderzone

    coderzone Super Moderator

    Joined:
    Jul 25, 2004
    Messages:
    734
    Likes Received:
    37
    Trophy Points:
    0
    The ERD needs lots of modification specially some of the relationships specially Book-BestSeller and Order-Book
     
  5. chickenyd

    chickenyd New Member

    Joined:
    Mar 11, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    0
    so shabir what you are trying to say is in the order entity i need tobstore time?? Ok i will try that then.
     
  6. chickenyd

    chickenyd New Member

    Joined:
    Mar 11, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    0
    coder zone explain what you mean by the ERD needs a lot of modification ?? HOW??/
     
  7. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,276
    Likes Received:
    364
    Trophy Points:
    83
    Yup. As you are tracking orders and need the mean and variance you need to be storing lots of time like OrderTime, DeliveryTime, ShippingTime ...
     
  8. coderzone

    coderzone Super Moderator

    Joined:
    Jul 25, 2004
    Messages:
    734
    Likes Received:
    37
    Trophy Points:
    0
    Book and Best seller your relationship is
    One Book is to many BestSeller but actually it should be BestSeller is a type of Book relationship. i.e. Is a relationship.

    Book and Order relationship
    It is One book many order but it should be Many Books one order.

    [COmment]Hey thats my Post No 100[/COmment]
     
    Last edited: Mar 12, 2006
  9. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,276
    Likes Received:
    364
    Trophy Points:
    83
    I would like to add that Order should not be an entity but it should behave as a relationship between Account (Customer) and Book.
    Also Congrats on completing 100 posts.
     

Share This Page