I want to create a database that has several customers and many orders per each customer and each order has several items in it. I was thinking of creating a table for each order and populate each order from an "items" table, but this solution seems cumbersome after you reach thousands of orders and will be pretty hard to query. Any suggestions? Your help is greatly appreciated.
closed as too broad by Nifle, terdon, Shekhar, Excellll, Journeyman Geek♦ Jul 27 '13 at 12:56
There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs. If this question can be reworded to fit the rules in the help center, please edit the question.
You can have table which keeps your customers. You can have table which keeps orders. You can have table which keeps items per order. Just link them correctly with foreign keys and it should work for you.
Table one has filed ID and field name.
Table two has field ID and field customer (which refers to ID of first table)
Table three has field ID, field ORDER (which refers to ID of second table) and field items (which can refer to ID of another table - ITEMS).
Not necessary it should be exactly like that - this is just general concept for you.