大家好,我正在爲我的公司開發一個帳戶包,使用Sql Server 2008和VB.Net。帳戶數據庫設計
我需要一些關於數據庫設計的幫助。
我有以下表
AccountsGroupMaster
GroupId int
GroupName nvarchar(50)
ParentGroupId int
CatId int
PrimaryGroup bit
CreatedByUser nvarchar(50)
CreatedOn datetime
上表將存儲在賬戶組,例如:流動資產等
Accounts Table
AccCode nvarchar(6)
AccountName nvarchar(30)
ParentAcc nvarchar(6)
GroupId int
上表存儲賬戶/分類帳。
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)
以上兩個表存儲transactions.The以上兩代表由VoucherNo列
現在我的問題是我是否應該保持在賬目表中的所有銀行賬戶或者我應該有一個單獨的鏈接銀行賬戶表。 由於每個銀行賬戶都應有其各自的分類賬。
請幫我設計這個數據庫。 謝謝