r/DatabaseHelp • • Jan 15 '17

Can a database function as a spreadsheet?

I work with Excel spreadsheets as part of my day to day work.

I can see various ways of improving them and making them easier / foolproof.

As I sit at night thinking about it I thought the best way would be for me to take on a project and learn to code it, so that certain tasks can be done by clicking a button.

As more thought goes into it I realise that a database would be needed and then I code certain behaviours and the look.

So I start to think about how to learn and plan a database. As I look into it and think about how it performs I cannot find a decent answer to the question of this post.

As an example, let's say I have 20 columns in my table. If I change a value in column 2 can a database be coded so that column 5 10 and 15 automatically change to reflect these changes. So the user sees the change straight away.

2 Upvotes

4 comments sorted by

View all comments

Show parent comment

3

u/Grundy9999 Jan 15 '17

It depends on how you set it up, and how much calculation needs to be done, but yes. Before you design this, keep in mind that there is usually little purpose in saving calculated values to a table (unless you are going to transform the data later in a later step or something). If Column 5 is always Column 2 + $3.00, then you could just save that formula in a query and have it calculate on the fly when needed, rather than have the database spend time with disk access to write and read the Column 5 value. It is also more challenging to update calculated values that are saved to a table if, for example, column 2 gets a new value.