Postgres Gallery: Implement a balance sheet in SQL
We are trying to create a gallery of interesting uses of SQL that most people don't readily know. The repository for this gallery is located here: https://github.com/pavanagrawal123/PostgresGallery/
For this task, you will need to add an entry into our gallery.
Description of entry: Balance sheets are a great way to keep track of expenses for personal reasons as well as business reasons.
In spreadsheet software, creating a balance sheet is super simple as it can easily reference cells from previous rows. However, this task is not as easy, as referencing previous rows is harder in SQL. (Check the GitHub issue to see what this should look like)
Check the README file in the Postgres Gallery repository on how to add a entry into the gallery, and submit a pull request on GitHub to complete this task.
In the PR you will need to include the following info:
1) A short description of the use 2) Sample code 3) Sample data
Your data should be representative of a real life use case, and your description should also match this.