Hi
I am designing and implementing an E-Commerce solution and needed a pointer on table constraints
I have the following tables
Category
CategoryId PK
CategoryName
Description
Version
CustomerEntity
CustomerId PK
CustomerName
City
Country
Version
Product
ProductId
CategoryId
ProductName
UnitPrice
UnitsInStock
Version
Order
OrderId
CustomerId
OrderDate
Version
OrderDetails
OrderId
ProductId
UnitPrice
Quantity
Version
Given the above I would like to implement a shopping cart table but do not know what columns to have nor what tables to reference with a Foreign Key?
Thanks
Loading
VulpesPosted Apr 6, 2012, 6:53 AM
VulpesPosted Apr 6, 2012, 7:12 AM
When an update is needed, you only then need to update it in one place which reduces the risk of the database becoming inconsistent.
Guest UserPosted Apr 6, 2012, 7:06 AM
Cheers again.
Steven
Guest UserPosted Apr 6, 2012, 6:09 AM
I should of been more clearer in my post.
I have allocated the Foreign Keys already on the existing tables.
My question was about how to add a Cart table and what columns should I implement. Im thinking CartId, Quantity, UnitPrice, ProductName, ProductId, Order Id.
Given these columns I will implement OrderId as the Primary Key, should I then reference the OrderId in the Order table to get the latest number for the order?
Thanks
Steven
VulpesPosted Apr 6, 2012, 5:24 AM