db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Pendleton <bpendleton.de...@gmail.com>
Subject Re: Problem retrieving the 'oldest' record
Date Tue, 03 Dec 2013 01:35:24 GMT
> It would appear that my so-called 'date' field is not a good field to have
> in a primary key!

You can have just about any datatype in your primary key.

The only hard requirement is that the primary key must be unique.

Using existing fields from your record which uniquely identify
your data is called using a "natural" primary key.

Another approach is to use a "synthetic" primary key by using
an abstract unique identifier for each row in your table.

Derby can assist with this by automatically generating values for
such a synthetic primary key.

Here's a great place to start learning about these issues:

http://www.agiledata.org/essays/keys.html

thanks,

bryan



Mime
View raw message