I am developing a stock market analysing web application. I have to store more over 20 years of data of 2000 company's with 150+ columns. My doubt is whether I have to create separate table for each company or single table. Which is faster.
2 Answers
before create database or decision you should design database with some tips and tricks.
i can't describe here cause of there are lots of points and tricks available.
that why i add link below for reference. you should read and implement as your requirement.
https://www.dummies.com/programming/web-services/exploring-database-design-tips/
https://www.vertabelo.com/blog/notes-from-the-lab/9-tips-for-better-database-design
Note :- don't use ready made database related your requirement do your self to improve your database decision.
Thanks

- 671
- 4
- 20
It depends generally. But most of the times in industry they follow normalization structure. My suggestion would be don't create each table for each company. Make a table for all the companies. Store their details in seperate tables. Try to make your tables to follow 1:1 relationship. So that you can easily get results. See below links please. If you want more performance make another table with only those columns which are very important.(You said 150 columns i don't think all of them are useful.)
Which is more efficient: Multiple MySQL tables or one large table?

- 2,337
- 1
- 13
- 14