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

Поиск
Список
Период
Сортировка
От Nis Jørgensen
Тема Re: Normalized Tables & SELECT [was: Find "smallest common year"]
Дата
Msg-id fdigqv$j7p$1@sea.gmane.org
обсуждение исходный текст
Ответ на Normalized Tables & SELECT [was: Find "smallest common year"]  (Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>)
Список 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: Normalized Tables & SELECT [was: Find "smallest common year"]
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Normalized Tables & SELECT [was: Find "smallest common year"]