
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
CREATE TABLE events ( event_type INT NOT NULL REFERENCES types (event_type), dt_start DATETIME NOT NULL, dt_end DATETIME, -- NULL means event goes on forever KEY (event_type) -- event_type is not unique );
Example: +------------+------------+------------+ | event_type | dt_start | dt_end | +------------+------------+------------+ | 20 | 2002-06-24 | 2005-06-24 | | 24 | 2001-02-12 | NULL | | 25 | 2002-04-01 | 2005-04-01 | | 25 | 2003-05-24 | 2006-05-24 | | 26 | 2003-05-24 | 2004-05-24 | | 31 | 2003-05-24 | NULL | | 40 | 2003-05-24 | NULL | | 42 | 2001-08-30 | 2006-08-30 | +------------+------------+------------+
CREATE TABLE conditions ( condition_id INT NOT NULL, event_type INT NOT NULL REFERENCES types (event_type), PRIMARY KEY (condition_id, event_type) );
Example: +--------------+------------+ | condition_id | event_type | +--------------+------------+ | 6 | 20 | | 6 | 26 | | 6 | 42 | +--------------+------------+
+--------------+------------+------------+ | condition_id | dt_start | dt_end | +--------------+------------+------------+ | 6 | 2003-05-24 | 2004-05-24 | +--------------+------------+------------+
Regards, Diego Berge. -- e-mail address invalid, please reply to newsgroups.
| <-- __Chronological__ --> | <-- __Thread__ --> |