=> Rates Table references Order or CustomerTable?

R

Rhonda Fischer

Hello,

In my database I have a Rates Table - listing
depots with associated supplier moneyrates. I'm not
sure whether to reference the Rates(Depot) to Orders(Depot)
or Customer(Depot)?

If I do join:
Rates(Depot) References Customer(Depot)
Order(Depot) References Customer(Depot)

then when I am creating queries do I need to join three
tables before I can calculate rates with number of
items ordered? When could just join Orders and Rates
table (M:1)?

Thank you for you help

Kind Regards
Rhonda

----------------------------------------------------------
This Table records the money rates per depot
----------------------------------------------------------
CREATE TABLE Rates
(
Depot varchar(30) NOT NULL PRIMARY KEY REFERENCES
Orders(Depot),
Bowes money,
GCP money,
GCFWitham money,
Redgrave money,
Ellingham money,
Cherryridge money,
Musks money,
Powters money,
Kosher money,
Isigny money,
FineItalian money
)
----------------------------------------------------------
This table records the number of items ordered per depot
----------------------------------------------------------
CREATE TABLE Orders
(
[ID] int NOT NULL PRIMARY KEY,
Run int,
[Del Date] datetime,
Depot varchar(30) NOT NULL REFERENCES [Customer]
(RDC),
TotalPals int,
Bowes int,
GCP int,
GCFWitham int,
Redgrave int,
Ellingham int,
Cherryridge int,
Musks int,
Powters int,
Kosher int,
Isigny int,
FineItalian int
)
----------------------------------------------------------
This table is a list of Customer depots
----------------------------------------------------------
CREATE TABLE Customer
(
Depot varchar PRIMARY KEY
...
)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top