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.

Recommended Answers

All 2 Replies

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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.