Countries Table

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
wizzard
Forum Commoner
Posts: 93
Joined: Thu May 16, 2002 5:36 am
Location: Belgium
Contact:

Countries Table

Post by wizzard »

Hello,

I'm working on an e-commerce but i have a question and maybe someone in here has experience with this:

I'm working worldwide Belgium, Japan, US,... now for all the countries there are different shipping costs and also per weight.

Like for Belgium, UPS, Express Mail US Same but their are different prices how do i best fix this with different tables for prices and countries... ?

Best Regards
Kris
User avatar
daven
Forum Contributor
Posts: 332
Joined: Tue Dec 17, 2002 1:29 pm
Location: Gaithersburg, MD
Contact:

Post by daven »

Ideally, something like this (yes, it is kind of excessive, but I am a stickler for DB normalization)

TABLE Country

Code: Select all

country_ID  INT
country_Abbr  VARCHAR
country_Name VARCHAR
TABLE Service // UPS, FedEx, etc

Code: Select all

service_ID  INT
service_Name  VARCHAR
TABLE Weight // range of shipping weights. This table might be superfluous (not useful) if the various Services use vastly different weight tables

Code: Select all

weight_ID  INT
weight  REAL
TABLE ShipCost

Code: Select all

weight_ID  INT
country_ID  INT
service_ID  INT
cost  REAL
wizzard
Forum Commoner
Posts: 93
Joined: Thu May 16, 2002 5:36 am
Location: Belgium
Contact:

Post by wizzard »

Thanks Daven for the help
Post Reply