If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Need Assistance for my Project

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-01-09, 09:13
MarineX MarineX is offline
Registered User
 
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.
Reply With Quote
  #2 (permalink)  
Old 07-01-09, 09:18
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
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:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #3 (permalink)  
Old 07-01-09, 09:22
MarineX MarineX is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 07-01-09, 09:26
MarineX MarineX is offline
Registered User
 
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?
Reply With Quote
  #5 (permalink)  
Old 07-01-09, 09:29
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
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:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #6 (permalink)  
Old 07-01-09, 09:32
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
I would not relate product directly to delivery. If you relate order to delivery, then product is then indirectly related.
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #7 (permalink)  
Old 07-01-09, 09:38
MarineX MarineX is offline
Registered User
 
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.
Reply With Quote
  #8 (permalink)  
Old 07-01-09, 10:09
MarineX MarineX is offline
Registered User
 
Join Date: Jul 2009
Posts: 24
anyone willing to aid me on this ?
Reply With Quote
  #9 (permalink)  
Old 07-01-09, 10:35
sqlguru sqlguru is offline
Registered User
 
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.
Reply With Quote
  #10 (permalink)  
Old 07-01-09, 10:39
MarineX MarineX is offline
Registered User
 
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.
Reply With Quote
  #11 (permalink)  
Old 07-01-09, 10:46
sqlguru sqlguru is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On