0

I am building a budget into a SQL Server database, in order to keep track of some items via either web app, or desktop app. My question is when keeping a budget over say five years is it better practice to have line items in one table with their descriptions, and all the years in another, say 60 columns for each month for five years, or have one table with each year and its given line items. for querying purposes it seems easier this way, but for referential integrity it seems the other way is better. Any insight would be great

essentially what i am trying to use this for is, compare and reporting on 5 years of assumptions vs, actual results over time

user1902540
  • 111
  • 2
  • 12

1 Answers1

2

60 columns for five years definitely breaks normalization rules. That way lies madness....

I can see categories that transcend years (e.g. "income taxes", "housing", "food").

I can see transactions that categories that roll up to years grouping by timestamps.

I can see predictions and actual values referring back to categories.

I don't see any of that in either of your proposed designs.

duffymo
  • 305,152
  • 44
  • 369
  • 561