all groups > sql server programming > march 2004 >
You're in the

sql server programming

group:

Table Structure


Table Structure Khurram Chaudhary
3/3/2004 10:38:10 PM
sql server programming:
I have a question regarding the best design for some tables. I have three
tables; Orders, BillingInfo and PaymentInfo. Right now, when a customer is
placing an order, they select a payment method (from PaymentInfo) such as
credit card, purchase order or on account. When they select something other
than 'on account', the PaymentInfoID in the Orders table is populated but
the BillingInfoID field is null.

Is there a better way to approach this?

Khurram

Re: Table Structure Uri Dimant
3/4/2004 8:05:17 AM
Hi
CREATE TABLE Orders
(
OrderId INT NOT NULL PRIMARY KEY,
Pay_Id_Info INT NOT NULL REFERENCES PaymentInfo(Pay_Id)
)
GO
CREATE TABLE PaymentInfo
(
Pay_Id INT NOT NULL PRIMARY KEY,
)
GO
CREATE TABLE Bill_Info
(
Bill_Id INT NOT NULL,
Pay_Id INT NOT NULL,
OrderId_Ord INT NOT NULL
PRIMARY KEY (Bill_Id,Pay_Id,OrderId_Ord)
)




[quoted text, click to view]

AddThis Social Bookmark Button