User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 403,516 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,867 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser: Programming Forums
Views: 364 | Replies: 2
Reply
Join Date: Jul 2008
Posts: 2
Reputation: sushantlikhar is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
sushantlikhar sushantlikhar is offline Offline
Newbie Poster

database design

  #1  
Jul 14th, 2008
Hi ,
I have designed a database that is to create a application simlar to microsoft money

The database erd is aattched with this post. The database has following table
Invoice
Amount
Account
Profit_center
Customer

A invoice can sometimes split in to 3 parts

therefore i have create table invoice

with following column
Invoice_id (PK)
Customer_ID(FK)
Date

I have created a Amount table
with
Invoice_id
Profit_center_ID
ACCOUNT_ID
Amount

I have created amount table as the amount of the invoice is dependent on Profit_center and Account.

From the application i will first update the amount table and then the invoice table.
I wanted to cross check if this is correct.
Attached Images
File Type: jpg AP.JPG (133.6 KB, 7 views)
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2007
Location: Adelaide, South Australia
Posts: 365
Reputation: darkagn will become famous soon enough darkagn will become famous soon enough 
Rep Power: 3
Solved Threads: 42
darkagn's Avatar
darkagn darkagn is offline Offline
Posting Whiz

Re: database design

  #2  
Jul 16th, 2008
The only thing I would say is that since you have a Foreign Key in Amount called Invoice_id, you will need to update the Invoice table before the Amount table. If you try to insert into Amount table for an invoice that you haven't entered into the Invoice table, you will run into problems.
The answer is 42.
Reply With Quote  
Join Date: Jul 2008
Posts: 2
Reputation: sushantlikhar is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
sushantlikhar sushantlikhar is offline Offline
Newbie Poster

Re: database design

  #3  
Jul 16th, 2008
thanks for taking time to look at this . I understand now that i have to update the invoice table first and then the amount.

Thanks again.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MS SQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MS SQL Forum

All times are GMT -4. The time now is 1:04 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC