Table design question

From: Karel Miklav <karel_at_inetis.spppambait.com>
Date: Fri, 23 Jan 2004 09:08:49 +0100
Message-ID: <ED4Qb.1906$%x4.322575_at_news.siol.net>


Hi,

constantly facing this design issue I decided to ask for some help. Consider the tables below; there is a user with historical data and a related table log:

CREATE TABLE user (

     id INT NOT NULL ) <---------------------

|
CREATE TABLE user_history ( | user_id INT NOT NULL, oo----------------| valid_from DATETIME NOT NULL, | name CHAR(100) NOT NULL, | ... ) |
|
CREATE TABLE log ( | id INT NOT NULL, | tstamp DATETIME NOT NULL, | user_id INT NOT NULL, oo---------------- description CHAR(100) NOT NULL, ... )

There are other related tables like log here, where I'm really not interested in historical data but just the identity of the user, and those where exact user properties in point of time matter.

The one-field user table smells like a design problem. Merging user and user_history tables introduces ugly problems with relational integrity. Are these one-field tables normal or how am I supposed to tackle this? Please share your thoughts and links.

Thanks,
Karel Miklav Received on Fri Jan 23 2004 - 09:08:49 CET

Original text of this message