I can think of 2 ways:
1. The data for each stock id quote are put into their own tables and a
map table to host the mapping of stock_id -> stock_table_name
2. All the data are put into a single big table. Query the data for a
particular stock id by it's ID number.
On option No.1. Since there could be a few thousand different stock
id's, which will corresponding to thousand of tables. Does sqlite handle
thousand tables in a single database file effeciently?
On option No.2. I guess updating and querying the data will be slower
than those of the option No.1.
What're the other better designs for this kind of data?
> A newbie question on database design. I'd like to store stock market data
> into a sqlite database. I wonder how to partition the data?
The normal procedure for designing a database is to list _all_ the
attributes you want to store, then go through the normalization process of
assigning each to a table. Lots of information on this on the Web and in
books.
You will make a better decision after you decide what information other
than ID and company name you will enter and what you want to do with the
data once it's stored.
Rich