Skip site navigation (1) Skip section navigation (2)

Re: Normalized Tables & SELECT [was: Find "smallest common year"]

From: Nis Jørgensen <nis(at)superlativ(dot)dk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Normalized Tables & SELECT [was: Find "smallest common year"]
Date: 2007-09-28 09:17:17
Message-ID: fdigqv$j7p$1@sea.gmane.org (view raw or flat)
Thread:
Lists: pgsql-general
A few more comments on your table design.

Stefan Schwarzer skrev:

> So, instead of the earlier mentioned database design, I would have
> something like this:
> 
>    - one table for the country names/ids/etc. (Afghanistan, 1; Albania,
> 2....)

There is a well-established natural key for countries - ISO 3166. Use
that instead of "id".

>    - one table for the variable names/ids/etc. (GDP, 1; Population, 2;
> Fish Catch, 3;....)
>    - one table for the years names/ids/etc. (1970, 1; 1971, 2; 1973, 3;
> ....)

No need for an ID column on this one. Just use the year as the primary key.



Nis


In response to

pgsql-general by date

Next:From: Richard HuxtonDate: 2007-09-28 09:21:20
Subject: Re: Normalized Tables & SELECT [was: Find "smallest common year"]
Previous:From: Tom AllisonDate: 2007-09-28 09:09:13
Subject: Re: Debian problem...

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group