If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > need help to design table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-06-03, 08:26
hendra1211 hendra1211 is offline
Registered User
 
Join Date: Dec 2003
Posts: 49
Exclamation need help to design table

i have designed tables for my store database. the purpose of my database is to make invoice for customer and input my buy invoice, calculate stock of my goods in the warehouse. here is the complete list :
PRODUCT TABLE
FIELD :
* PRODUCT ID
PRODUCT NAME
FIRST STOCK

CUSTOMER TABLE
FIELD :
* CUSTOMER ID
CUSTOMER NAME
etc....

SUPPLIER TABLE
FIELD :
*SUPPLIER ID
SUPPLIER NAME
etc.....

TRANSACTION TABLE
FIELD :
* INVOICE ID (AUTONUMBER)
SUPPLIER ID
BUY INVOICE NUMBER ( INVOICE NUMBER FROM SUPPLIER, CREATED BY SUPPLIER)
BUY INVOICE DATE
SELL INVOICE NUMBER (INVOICE NUMBER FROM MY STORE)
CUSTOMER ID
SELL INVOICE DATE

TRANSACTION DETAIL TABLE
FIELD :
* TRANSACTION ID (AUTONUMBER)
PRODUCT ID
PRODUCT NAME
QUANTITY IN (BUY)
BUY PRICE
QUANTITY OUT (SELL)
SELL PRICE

THE RELATIONSHIPS ARE :
PRODUCT ID [PRODUCT TABLE] WITH PRODUCT ID [TRANSACTION DETAIL TABLE] (1 TO MANY)
INVOICE ID [TRANSACTION TABLE] WITH INVOICE ID [TRANSACTION DETAIL TABLE] (1 TO MANY)
SUPPLIER ID [SUPPLIER TABLE] WITH SUPPLIER ID [TRANSACTION TABLE] (1 TO MANY)
CUSTOMER ID [CUSTOMER TABLE] WITH CUSTOMER ID [TRANSACTION TABLE] (1 TO MANY)


is my design right? anyone help me to design the right way please.
the problem in my design is i can't check the stock of my goods before any transaction (buy or sell) of the goods. But after any transaction occur i can check it and it add the first stock of the good in my inventory. i want to know if it is possible to me to add the first stock of my goods and i can check it before any transaction occur.
thank you, sorry my english is bad.
__________________
hendra gunadi
__________________
hendra gunadi
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On