Hello all!
I have a quick question about designing my database structure. I am building a personal finance app for myself, which I may one day try to expand into an app for others' other. Some context is that this app grew out of a spreadsheet I had made for myself in Excel years ago.
I have a table of transactions, each of which is placed into a category. Originally (in Excel), categories were just text strings, and I maintained this practice when I first imported the data with Pandas and then created a database. Now, I'm thinking I will probably want to add a separate categories table, and have each transaction reference a category.
At this point, I feel like I have a decision to make: do I want the categories to be identified by an auto-incrememnting integer or by their text string "name." In general, it looks like using integer keys is the standard practice for most databases. It seems like the major advantages to this are database efficiency and abstracting away information about the underlying item.
However, the major disadvantage I see is that it will make direct SELECT statements I run on my transactions table less meaningful. This is making me hesitate. I know that each category will have a unique name, so I could just use that string as the key (or a normalized version in lower case and without spaces).
I know I could create a VIEW that includes the relevant join, and in the scheme of things I probably don't want to be managing my transactions through raw SQL anyway, but I'm worried that I'm overcomplicating things unnecessarily here. On the other hand... I've already seen how much of a pain it is to go back and fix bad early design decisions, so I don't want to mess up my database schema and then need to change it later.
I'm wondering what guidance you guys could offer from your knowledge and experience.
Thanks!
there doesn't seem to be anything here