Jump to content

2500 columns...is mysql for me?


lindm

Recommended Posts

I have some little experience of mysql and php and am planning a project that could involve 2500 columns of a database. The project is nothing fancy but a financial report for companies. I am however not sure this is such a good idea or even possible?? Would much appreciate advice on the matter.

 

For you to get the idea, the table would basically be set up with the following columns:

 

ID

Password

Company

Setting1

...

Setting50

Turnover

...

ProfitLossforTheyear

Asset1

...

Asset100

TotalAssets

Equity

...

Debt1

...

Debt100

TotalDebt

Notedata1

...

Notedata1500

 

 

Link to comment
Share on other sites

Yesterday I told you that MySQL is not a spreadsheet and you had a problem with your design. I gave you this link to read:

 

http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html

 

Two hours later you post this. So, clearly, any advice we give you is completely ignored.

 

Why should we waste our time?

Link to comment
Share on other sites

Hello Barand,

 

Understand your point. For a non-native english speaking person and a basic skilled mysql user the article has somewhat complicated text:

 

I have read the article but can mainly see one "normalization" issue: the company data and the financial report data. The fact still remains that I will have approx 2500 columns of "spreadsheet data" each company. Is splitting the financial report in different tables (ie one for settings, one for income statement, one for balance sheet, one for notes etc) really necessary? Each column will mainly contain figures not exceeding a 6-figure amount. Each column of the financial statement is unique for the company and not like an "author-column" in the article example.

 

Where ever I read the main idea is that mysql databases over 30-60 columns is not designed well. I will never come down to this figure...

 

My basic question is if a mysql database with 2500 columns containing unique very little data will cause problems? What type of problems (the article mentions "data redundancies, data anomalies, and various inefficiencies", please help me understand)?

 

Thank you

Link to comment
Share on other sites

Fenway,

 

Hope you don't mean one table per field??

 

Perhaps the following setup is better?

 

Table User : Contains user data, approx 5 columns

Table Settings : Contains user settings, approx 30 columns

Table Income : The income statemetnt, approx 100 columns

Table BalanceAsset: Balance sheet Assets, approx 100 columns

Table BalanceDebt: Balance sheet Debts, approx 100 columns

etc

etc

 

 

Link to comment
Share on other sites

1...N mainly represent unique form elements such as text fields, text areas as well as some checkboxes. The user will enter numbers or text into the form elements press save to save each element to the database.

 

So each user will have a set amount of unique form elements/mysql columns.

Link to comment
Share on other sites

Much appreciate your input Fenway.

 

So I will probably have some table with 500 columns...are there any risks or problems with this large amount of columns?

 

Is there any way to make the setup more ideal?

 

Should I perhaps consider other database solutions?

 

 

 

Link to comment
Share on other sites

Response to Barand,

 

There is a fixed input field in a html form for each mysql column. For instance the contents of input field with id/name Debt1 will be recorded to column Debt1 in the mysql database when the user presses Save.

Link to comment
Share on other sites

I'd set it up as several tables like this

[pre]

User                   

=====                 

ID        --------+                  ----+                        ----+

Password          |    Income          |      BalanceAsset          |      BalanceDebt

Company          |    ==========      |      ==============        |      =============

Setting1          |    idIncome        |      idAsset                |      idDebt

Setting2          +---< userID          +----< userID                +----< userID

...                    dateRecd                assetDescrip                  debtDescrip

SettingN                amount                  amount                        amount

[/pre]

 

For example, instead of 100 columns in one record for income, have a table with a row for each income amount, added as you need to.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.