SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Accounting Database Design


Accounting Database Design

Author
Message
mandar.dasgupta
mandar.dasgupta
SSC Rookie
SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)SSC Rookie (28 reputation)

Group: General Forum Members
Points: 28 Visits: 51
Hello everyone i am developing an accounts package for my company using Sql Server 2008 and VB.Net.

I need some help regarding the database design.

I have the following tables

AccountsGroupMaster

GroupId int
GroupName nvarchar(50)
ParentGroupId int
CatId int
PrimaryGroup bit
CreatedByUser nvarchar(50)
CreatedOn datetime

The above table will store the Groups for the accounts eg: Current Assets etc.

Accounts Table

AccCode nvarchar(6)
AccountName nvarchar(30)
ParentAcc nvarchar(6)
GroupId int

The above table stores the Accounts/Ledgers .
VoucherMain

VoucherNo bigint
VoucherDate datetime
DebitCredit int (0 for Credit 1 for Debit)
AccCode nvarchar(6) (Account Code to be debited/Credited)
UserID nvarchar(30)

VoucherDetails

VoucherNo bigint
SlNo int
AccCode nvarchar(6) (Debit this account if account in VoucherMain credited/ Credit this account if account in VoucherMain Debited)
Amount decimal(18, 2)
Narration nvarchar(MAX)



The above two tables store the transactions.The above two tables linked by the VoucherNo columns


Now my question is whether i should maintain all the bank accounts in the accounts table or should i have a separate table for the bank accounts.
As each bank account should have its respective ledgers.

Please help me in the design of this database.
thanks
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (218K reputation)SSC Guru (218K reputation)SSC Guru (218K reputation)SSC Guru (218K reputation)SSC Guru (218K reputation)SSC Guru (218K reputation)SSC Guru (218K reputation)SSC Guru (218K reputation)

Group: General Forum Members
Points: 218556 Visits: 41996
What is the difference between what you've designed the Accounts hold and a Bank Account?

Also, why do you need to identify a "Primary Group" and why are you using 4 bytes to identify a credit or a debit?

I also hope you know enough about "Adjacency List" hierarchies to be able to constrain the tables to prevent "cycles" and duplicates in the hierarchical tables.

You've taken on a lot to chew and we haven't even started on the VB side of the code. My recommendation would be to your company would be to abandon this task and buy a copy of "Quick Books Professional" or some such. It'll save your company a whole lot on time and mistakes.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
dave-318819
dave-318819
Valued Member
Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)Valued Member (61 reputation)

Group: General Forum Members
Points: 61 Visits: 52
You should have a separate table for banking transaction, and a separate one for maintaining the bank name, address, contact that can link to the first one. Looking from your tables above, is that all you have in your ERD?
What about Inventory, Sales and Purchases, don't you think you need a place to store them too? I see you have two tables for voucher, are these for storing payment transaction, if yes, you need to create a referential identifier to your vendor table, and vice-versa for your sales transactions? It's too elaborative to explain further from here, but i do encourage you do find out more on the database structure and designing concepts before you embark further on your project. Derek Liew seems to have some good designing concept for a simple accounting database and you may take a look at it at accountingdes.com
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search