database - How to design table for dynamic number of columns? -
requirement: have capture data day in particular time intervals(time interval constant set of data). time interval can range 5 minutes 2 hours . number of data points day can vary 12 288. how should design our table accommodate variation.
can go adding 288 columns in table ? if time interval 5 minutes 288 columns occupied. if 2 hours 1st 12 columns occupied. , on.
you not want 288 column table.
it's difficult design table no concept of other tables around it, basicaly - have column time, , add other times. if have time related object, ad foreign key object relates to. if want intervals rather time can have 'interval' column, notes interval part of.
"timeofevent" pk timeofeventid fk eventid interval timestamp
Comments
Post a Comment