473,383 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Is this an acceptable way to design an accounting, purchasing set oftables?

For an accounting / banking database, I have the following in a two
transaction tables showing what someone spends or credits:

Transaction Table //one only
--
TransactionID
UserID
TransactionItemID Table //many
--
TransactionItemID
TransactionID
ItemID
AccountTable //one to one from TransactionID Table
--
AccountID
TransactionItemID
UserID
Debit
Credit
Balance
One transcation, many items tied to that single transaction. Results
of that transaction put in the account table. Is this right or too
many tables?

Jun 27 '08 #1
1 1110
On Jun 16, 4:06*pm, jmDesktop <needin4mat...@gmail.comwrote:
For an accounting / banking database, I have the following in a two
transaction tables showing what someone spends or credits:

Transaction Table //one only
--
TransactionID
UserID

TransactionItemID Table *//many
--
TransactionItemID
TransactionID
ItemID

AccountTable //one to one from TransactionID Table
--
AccountID
TransactionItemID
UserID
Debit
Credit
Balance

One transcation, many items tied to that single transaction. *Results
of that transaction put in the account table. *Is this right or too
many tables?
why do you need 'userId' in accountTable ? you have transactionItemId
which will get you the userid in the transactionTable

what do you mean by 'Results of that transaction put in the account
table', do you have a function that updates the accountTable based on
what was entered in the transactionItemTable ?

wondering why this can be done with 2 tables
Transaction Table //one only
--
TransactionID (pk)
UserID (fk)
transactionDate

TransactionDetail Table //one to one from TransactionID Table
--
TransactionID (pk) (fk)
ItemID (pk)
AccountID (fk)
Debit
Credit

Account Table
--
accountId (pk)
accountName
balance

User Table
--
userId (pk)
userName
Item Table
--
itemId (pk)
itemDescription
to answer another post, you should never store a total / balance, you
should always calculated it, with proper indexing, sum millions of
records should be quick

but I did add a balance field to the accountTable to deal with
deleting old transactionDetails. To start the balance is 0 and your
query will sum the credit / debit from transactionDetails and add
accountTable.balance

a 'delete' function will update the accountTable.balance with the
balance of the deleted transactions, so that the above query will give
you the same results after the 'delete' is done
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: jenniferyiu | last post by:
IMHO, simply NO. False actually, practically.
6
by: Andreas Pauley | last post by:
Hi All, Our company is currently evaluating Python as a language for writing financial/accounting type software (among others). What libraries or packages are available in this domain for use?...
29
by: steve | last post by:
Hi, Recently I have been looking at the various ways people are implementing, interaction between java & oracle databases. I was always instructed on the purity of the data model, "normalize...
3
by: Rushikesh | last post by:
I am designing a WEB BASED Accounting Software with ASP and SQL Server. For this I need some help for the Database design. My design is as follows. I)User table: User_id, UserName..... Users...
5
by: Don Vaillancourt | last post by:
Hello all, Over the years as I design more database schemas the more I come up with patterns in database design. The more patterns I recognize the more I want to try to design some kind of...
5
by: Peter Mount | last post by:
Hello Where can I find a good source for schemas in Access for doing accounting systems or simlar? I'm currently looking to develop some database tables for a simple accounting setup using...
4
by: KnightKnives | last post by:
Is there anyone out there who could help me find the resources I need in order to make this application. I have done a lot of work with 2.0 engine then upgraded to 97; now have 2003. I have...
5
by: perspolis | last post by:
hi everyone In my accounting database ,there are several account like Persons,Banks,.... I design them in separated table. in your opinion ,it's better to have all in one table or separated...
1
by: Rusty Hill | last post by:
In ASP.net 2.0 I need to create a scheduling page that allows my users to book/schedule/reserve six different surgery rooms. What the design calls for is one screen that has the daily schedule on...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.