Forum Moderators: open
one database with 4 table:
1. categories table.
2. product table.
3. order table.
4. orderdetails table.
very basic relation database. The categories table is for one-to-many, and the product table is for many-to-many with the category entity.
All table will start of with the top field reserver for the ID(primary key) for internal identification.
My question is.
Since I already have an ID field. Do I need a parent_id field in the categories table for it to work(query) with the product table. Or can I just create the categores table with something lookin like this.
ID Int null Primary Key
CategoriesA Varchar
CategoriesB Varchar
CategoriesC Varchar
and so forth.
product
-------------
productId
productName
(categoryId) if a product can only be in 1 category otherwise:
productCategory
-------------
categoryId
productId
order
-------------
orderId
productId
otherInfo
not sure why you need an orderDetails table as well, but maybe you do.
Chip-
order
-------------
orderId
customerID
orderDate
paymentType
lastModifed
orderStatus
dateShipped
orderitems
-------------
orderitemID
orderId
productId
quantity
inventoryStatus (out of stock, backordered,etc)
shippingAmount
discountAmount (coupons, discounts, etc)
productTotal
Just my .02.