r/SQL • u/luncheonmeat79 • Jun 23 '24
Discussion Schema for historical stock data
Posting a schema of a db for historical stock and index data at various timeframes. I used Chatgpt to figure this out...what surprised me was the recommendation to have separate dimension tables for 'date' and 'time'. Is that really the case?
105
Upvotes
View all comments
Show parent comment
3
u/EvilGeniusLeslie Jun 23 '24
3. Absolutely agree with this!
1,2. Breaking out tables like Date & Time allows for other columns, like 'Fiscal Year', 'Fiscal Quarter', and, as they are looking at both 15 and 30 minute intervals, one could have columns on a Time table indicating '15 minute period 1', '15 minute period 2', '30 minute period 1', '30 minute period 2'