On Sat, Mar 15, 2014 at 9:38 AM, willy Hakizimana <willyh...@gmail.com> wrote:
> First of all, this community is amazing at how fast questions are answered.
> I have learned so much.
>
>
> I am designing an app with models that look like this.
>
> Country(country_id(PK), country_name, gdp, gdp_growth, income_per_capita)
>
> Product(product_id(PK), product_name, country_id(FK), imports_volume)
>
> Since I have to show imports_volume for the same product in each country, I
> am stumped on how to design the db.

I'd have a country table, a product table, and a product_country table:

Country(country_id(PK), country_name, gdp, gdp_growth, income_per_capita)
Product(product_id(PK), product_name)
Product_Country(id(PK), product_id(FK), country_id(FK), imports_volume)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACwCsY4WPcy6B6PeFY94TbOTF3eN9B2bc4DM8R_LAGe1EyKj7g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to