Solved

Database Design Query for Computer Shop

Posted on 2003-11-04
5
827 Views
Last Modified: 2012-06-21
I have a query regarding the design of my database in MS Access
There will be parts sold and parts in stock.
Should i have 2 tables SOLD and IN STOCK?
OR should i have one table called STOCK with a YES / NO option under a field called SOLD?

 i will also be using this database for a tool hire program.

Say if a customer returns PART001, can i open a text file called PART001 and
add the customers name to the text file,so i have a history of who took the part and
then i dont need to clutter my database with this info
0
Comment
Question by:jxharding
  • 2
  • 2
5 Comments
 
LVL 46

Expert Comment

by:tbsgadi
ID: 9685029
How about this...
You Should have

1) Table :Parts
2) Table: Parts Movement -With CustomerID, PartID,Date ,No Parts,MovementType,
3) Table: Customers

MovementType being 1.add to Stock or 2.Sell etc

You certainly shouldn't use the text file...That's what the database is for!!
0
 
LVL 3

Expert Comment

by:jjjtuohy
ID: 9685482
This is a basic inventory structure.

1) Parts Table:  Parts_ID, Parts_Type, Parts_in_Stock

2) Customer Table: Customer_ID , Surname, First_name, Address1 etc

3) Transaction Code Table: Transaction_Code, Transaction_Type  (1 Sold, 2 Out of stock 3 Hired etc). This allows future flexibility.... you simply add new codes to this table.

4) Transaction Table: Transaction_ID , Transaction_Code, Date, Parts_ID, Customer_ID, Number_of_Parts, Comments

NOTE:
Parts_ID, Customer_ID, Transaction_ID in their respective originating table are {autonumbered primary key}

John
0
 

Author Comment

by:jxharding
ID: 9685749
thanks a lot,will be trying it today
0
 

Author Comment

by:jxharding
ID: 9687677
will i be deleting a part from the parts table if it is sold then and just move it
into transaction table?
0
 
LVL 3

Accepted Solution

by:
jjjtuohy earned 50 total points
ID: 9693224
Parts table: The Parts_in_Stock field  will decrement as you give out stock and increment as you bring in new stock. It is simply a count of current stock.
Transaction table: There is no moving stuff over or anything like that. the transaction table is precisely that.... a full historical record of every transaction undertaken. From it you can extract the information you require eg All the records relating to a particular customer, all the records in a particulat time period, all records relating to a particular part etc.
John
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now