proper format for this database table

Carsten Haese carsten at uniqsys.com
Fri Oct 20 11:32:08 EDT 2006


On Fri, 2006-10-20 at 10:57, John Salerno wrote:
> mensanator at aol.com wrote:
> 
> > you should rethink it as
> > 
> > [id] [university] [yearStart] [yearEnd] [degreeEarned]
> > 1     U of I       1971        1975      BS
> > 1     U of I       1975        1976      MS
> > 1     U of I       1976        1977      PhD
> > 
> 
> Thanks guys. I do plan to have an id entry for each person as well, I 
> just forgot to mention that. But since it's a primary key, I didn't know 
> I could list it more than once. Or does primary key not necessarily mean 
> unique?

Primary key *does* mean unique in the table that defines it. However, if
you take a primary key ID from one table and store it in a different
table, that's a foreign key. There are no inherent uniqueness
constraints on a foreign key.

-Carsten





More information about the Python-list mailing list