I have some data that is stored by the year it is related to. So I have one 
table that stores the Year the data is related to, among other things. At any 
given time, 1 year is considered the 'active year', and the rest are 
considered inactive. 

The table is something like:
CREATE TABLE Data_Info
Data_Info_ID    INT,
Year                    INT,
...

So my question is how do i best store which year is active. 2 designs come to 
mind:
1) add a column such as:
        Status  ENUM('Active', 'Inactive')
and adjust accordingly as the active year changes.

2) have a separate table:
CREATE TABLE Active_Data (
Data_Info_ID            INT,
Key (Data_Info_ID),
FOREIGN KEY (Data_ID) References Data_Info(Data_Info_ID)
);

With design 1, i need to make sure that only 1 record is ever set as 'Active'.

With design 2, there will only ever be 1 record in the Active_Data table.

Neither idea seems very good to me.

Any suggestions?

thanks much
sean peters
[EMAIL PROTECTED]

mysql, query


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to