Take the 2-minute tour ×

I have a table that consists of 1440 columns in a MySQL database. The columns names are: id,name,email,phonenumber,and also datewithtime columns like 1'st january_2012_00:00, 1'st january_2012_00:30, 1'st january_2012_01:00, 1'st january_2012_01:00, 1'st january_2012_02:00,..., 1'st january_2012_24:00.

Can I maintain all of these columns in a single table or can I divide the single table into multiple tables and make an association between them? What is the best solution for me?

share|improve this question
What are the datewithtime columns being used for? –  Jack Hughes Nov 9 '12 at 10:08
add comment

1 Answer

You should create a table containing (UserId, SomeDateColumnName, SomeValueColumnName)

Then, the value of each column in your table will go into a row in this new table. Ex:

instead of

Id  Name  Email  Phone  1stjanuary_2012_00:00  1stjanuary_2012_00:30 ...
1   A     A@A.A  123    Value 1                Value 2

You will have

Id  Name  Email  Phone
1   A     A@A.A  123


UserId  DateColumn           ValueColumn
1       2012-01-01 00:00:00  Value 1
1       2012-01-01 00:30:00  Value 2
1       2012-01-01 01:00:00  Value 3
1       2012-01-01 01:30:00  Value 4
2       2012-01-01 00:00:00  Value 123
2       2012-01-01 00:30:00  Value 234
2       2012-01-01 01:00:00  Value 345
2       2012-01-01 01:30:00  Value 456
share|improve this answer
first of all thanks cuberdude.sorry for the late reply.i normalize my table on that way.its working properly... –  chandu Nov 24 '12 at 11:21
Glad it helped. How about marking it as an answer? (you have 0% accept rate, you should start marking answers) –  CyberDude Nov 26 '12 at 7:10
add comment

Your Answer


