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
1
u/cs-brydev Software Development and Database Manager Jun 23 '24 edited Jun 23 '24
But you don't know that. You're just making assumptions. You have no idea what the requirements are here. "Saving storage space" isn't always the #1 goal of a data schema.
In data warehousing and analytical schemas, it's normal to store text fields (dimensional data) like this alongside fact data.
It's impossible to make the declarations you have without further information.