Results 1 to 11 of 11
  1. #1
    Join Date
    Jul 2009
    Posts
    24

    Kindly close this. thanks.

    ["http://img195.imageshack.us/img195/695/picture2epi.png"]Kindly remove this.. im kinda confused with it.
    Last edited by MarineX; 07-01-09 at 11:42.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    That is significantly better and would have been a much better starting point. Your original question, with no work done, is totally different to requesting a critique.

    How are the ordered items and delivered items related? It appears that there is nothing to prevent a customer getting items they didn't order....
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Jul 2009
    Posts
    24
    Quote Originally Posted by pootle flump
    That is significantly better and would have been a much better starting point. Your original question, with no work done, is totally different to requesting a critique.

    How are the ordered items and delivered items related? It appears that there is nothing to prevent a customer getting items they didn't order....
    hmm.. so how i should improve? im kinda lost.

    i apologise i am extremely weak in this module.. which even after reading the notes over and over again i still don't quite get a number of stuffs.

  4. #4
    Join Date
    Jul 2009
    Posts
    24
    based on what you have said, is there a way for me to cut across? Like from the Product all the way to Delivery?

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    I think you've done an ok job so far.

    Think of it in natural English.
    A customer order product(s) - you've modelled this.
    This order is then delivered to the customer - you have not modelled this correctly, as your delivery is not related to the order. A customer will not receive stuff they didn't order, right?

    So now you need to think "what is a delivery?". Is it just the order being delivered? If so, is delivery really an entity in its own right? Or could it be that a single order might be sent in several separate deliveries? In that case, there could be an delivery entity.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  6. #6
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    I would not relate product directly to delivery. If you relate order to delivery, then product is then indirectly related.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  7. #7
    Join Date
    Jul 2009
    Posts
    24
    Quote Originally Posted by pootle flump
    I would not relate product directly to delivery. If you relate order to delivery, then product is then indirectly related.
    so if you were in my shoes, how would u relate to make it correct? im kinda lost.

    my rules is actually like this;

    customer order products then
    the employee will retrieves product info and
    makes the delivery to the customer.

    correct me if im wrong.. what u mean at post #5 is that.. i need to have another Order attribute for my "DELIVERY entity" to absorb the order details from the product and to ship to more customers

    OR

    Delivery entity > Shipment entity. Leaving out the Customer entity from Delivery entity.
    Last edited by MarineX; 07-01-09 at 09:44.

  8. #8
    Join Date
    Jul 2009
    Posts
    24
    anyone willing to aid me on this ?

  9. #9
    Join Date
    Jun 2009
    Posts
    66
    [Customers]
    customer_id PRIMARY KEY

    [Employees]
    emp_id PRIMARY KEY

    [Products]
    product_id PRIMARY KEY

    [Orders]
    order_id PRIMARY KEY
    product_id FOREIGN KEY
    customer_id FOREIGN KEY

    [Delivery]
    delivery_id PRIMARY KEY
    order_id FOREIGN KEY
    emp_id FOREIGN KEY
    customer_id FOREIGN KEY


    Don't forget temporal data types such as delivery_scheduled, delivery_date etc.

  10. #10
    Join Date
    Jul 2009
    Posts
    24
    Quote Originally Posted by sqlguru
    [Customers]
    customer_id PRIMARY KEY

    [Employees]
    emp_id PRIMARY KEY

    [Products]
    product_id PRIMARY KEY

    [Orders]
    order_id PRIMARY KEY
    product_id FOREIGN KEY
    customer_id FOREIGN KEY

    [Delivery]
    delivery_id PRIMARY KEY
    order_id FOREIGN KEY
    emp_id FOREIGN KEY
    customer_id FOREIGN KEY


    Don't forget temporal data types such as delivery_scheduled, delivery_date etc.
    gee, thanks. what about the diagram? pootle flump mentioned there is an issue with it.

  11. #11
    Join Date
    Jun 2009
    Posts
    66
    Delivery should be related to order because you can find the customer from an order, but you cannot find the order from a delivery.

    Also, in the example I gave, there is no need to have a customer_id foreign key because you can find the customer from an order
    [delivery]
    delivery_id
    order_id
    emp_id

    And employees should be renamed personnel (have you ever heard management say "do you have any employees on hand?"). Also, employees can be customers as well etc.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •