Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Here is what I would do:
Customer.DBF
============
CustomerID
Address
Orders.DBF
==========
CustomerID
OrderID
Shipping.DBF
============
OrderID
PaymentID
Payments.DBF
============
PaymentID
Desc
Customer is linked with Orders on CustomerID
Orders is linked with Shipping on OrderID
Shipping is linked with Payments on PaymentID
I assume that an order is unique, so you don't have to include the CustomerID in the link between Orders and Shipping. Payments should contain all the list of acceptable payment types.
HTH
>I am working on an application that tracks the sale of books. This is my basic database design. Just wondering if this is a good schema. I have a customer table that list customers with address (the requirements only require one address). I have an orders table which has a field for the customer id as well as order id. They only order one book. However, there are various methods of delivering the product to the client. They may pickup it up at the office or have it mailed to them. I decided not to put that information in the orders table but to create a separate table for shipping address which is link to orders table by customer id and order id. The only information that goes in the shipping table is when the order is shipped. Also I have cases that involved the various methods of payment, ie by cash, check, purchase order, credit card, billing. Each of those require different info. Should I create a table for each of types of payments. I know I could place the info in
>the orders table but then in case where there is a check all the other fields would be blank creating a lot of unneccesary blank fields. In the case of billing I was going to do just like I did for shipping. The orders table has a field indicating the type of payment. Any help would be appreciated.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement