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 help with Database Design

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-12-09, 13:58
fishtank fishtank is offline
Registered User
 
Join Date: Apr 2009
Posts: 2
Need help with Database Design

I have recently started learning php and know basics like insert, update, delete etc from a database.

I am trying to design a database as an exercise to try and learn/understand how it is done but I'm not sure if I'm doing it right.

I have attached an image of what I have done so far and would apprieate any pointers on what is wrong/right or should be changed.

I am trying to achieve the following rules for my database design.
(The design is for a website building company)

1. Each customer can place many orders
2. If the product is a website package it can come with 1 or more domains.
3. Each product from that order is then linked into a project.

An example would be customer name = Joe Bloggs

Joe places an order for 1 website and 2 domains (joebloggs.co.uk and joebloggs.com) in the same order he also buys a Logo Design for his website (this is a product with no domain name).

I have slightly confused myself again by typing all this but hopefully someone can understand what I am trying to achieve and can point me in the right direction.

Thanks
Attached Thumbnails
Need help with Database Design-db_design.jpg  
Reply With Quote
  #2 (permalink)  
Old 04-12-09, 14:27
dportas dportas is offline
Registered User
 
Join Date: Dec 2007
Location: London, UK
Posts: 732
What are the keys of order_product and project_domain_product? It isn't obvious from your diagram whether they have keys at all.
Reply With Quote
  #3 (permalink)  
Old 04-12-09, 15:36
fishtank fishtank is offline
Registered User
 
Join Date: Apr 2009
Posts: 2
I'm not sure really, what I have done so far is just from my understanding from examples I've seen. My order_product and project_domain_product tables are made up from other tables, I don't even know if they are needed as I have only ever dealt with single table databases so far.

Please suggest if think there is a better way.
Reply With Quote
  #4 (permalink)  
Old 04-12-09, 15:44
dportas dportas is offline
Registered User
 
Join Date: Dec 2007
Location: London, UK
Posts: 732
Learning by example alone won't get you far. I suggest you get a decent book unless you are already taking lessons. There are quite a few good books on design but as you seem to be new to databases generally one of the best places to start may be:
Amazon.com: Introduction to Database Systems, An (8th Edition): C.J. Date: Books
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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