var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
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.
What are the keys of order_product and project_domain_product? It isn't obvious from your diagram whether they have keys at all.
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.
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