Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8756673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:08:03+00:00 2026-06-13T14:08:03+00:00

I’m a junior programmer and particularly novice at database design. A while ago in

  • 0

I’m a junior programmer and particularly novice at database design.

A while ago in my spare time i created a program to track and graph share price changes in java. At the time i couldn’t be bothered installing a DB for it, so it just used a pile of CSV files to store the data, one of each stock being tracked (e.g GOOG.csv, BHP.csv ).

Iv’e decided to update it to use a database as a learn activity, but in my design i hit a hurdle.
Should i continue my previous design of separate data piles for each stock or integrate them. That is to say, should i have a table per tracked stock, with a new record for each days data, or should i have a generic “Stock data” table with a identifier for the stock.

The first seems more straight forward, getting all the records would be as simple as

SELECT * 
FROM GOOG

Where as the 2nd would be

SELECT *
FROM stock_data
WHERE stock_name="GOOG"

Like i said, i’m a total database novice. To me, the first seems like it would be faster, but an overall a poor and hard to manage design, that wouldn’t scale well.
The 2nd seems like it might be needlessly slow if the first is fine.

I realize that due to the scale of my project, either would likely work fine, but as a rule for this type of problem, which would be the correct design choice?

Any sage DB design advice welcome. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:08:04+00:00Added an answer on June 13, 2026 at 2:08 pm

    By chance, I too wrote a similar program to track my own investments. A suitable schema would be

    STOCKS
    id or stock tracker or something unique
    name
    
    PRICES
    stock (foreign key to stocks)
    curdate
    price
    

    The primary key of the prices table would be stock + curdate.

    If you want to track purchases, sales, dividends and costs then you will need at least one more table (if not two). Most of my investments are in bonds with complicated redemption schemes, so I have a few special tables for them as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a reasonable size flat file database of text documents mostly saved in
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.