Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Payment table structure

Author  Topic 

sako
Starting Member

43 Posts

Posted - 2005-06-17 : 13:31:12
Hello,
I have to create a small online shop database.

The customers will be able to pay with credit cards or with bank account and so on.

should i create a table as "Payment" with all possible payment types?
or create for each type its own table like CreditCardPayment and BankPayment? In each table must include the customerID as FK of course.

A Hint or link about the theme will also help :)

Thank you.

X002548
Not Just a Number

15586 Posts

Posted - 2005-06-17 : 14:23:24
1 Payment table, make sure you include the order ID..can you also make more than 1 payement per order?

I would make the key to the table PaymentID, OrderID, and payment date



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page

sako
Starting Member

43 Posts

Posted - 2005-06-17 : 14:36:55
Thank you for answering,

I think i didnt explain my problem quite enough.

What i couldnt sort is, that the Credit card has number, validation date, card number, and so on.
via bank is a little diffrent, it has account number, bank number, bank name, etc...

another payment ways like Mobile looks again diffrent.
here user must call a number and i must save his mobile number.

so, how to sort these diffrent payment types in one table? or should i create for each type its own table?

:-)

Thanks again.
Sako.
Go to Top of Page

jhermiz

3564 Posts

Posted - 2005-06-17 : 16:03:27
For each type its own table?? I dont think so.
Try creating a table that has the various types, and reference that type as a foreign key.




Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]
Imperfection living for perfection --
[url]http://jhermiz.blogspot.com/[/url]
Go to Top of Page
   

- Advertisement -