Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 7th November 2008, 02:39 AM
crainey69 Offline
Registered User
 
Join Date: Oct 2007
Location: Macon, MO
Age: 44
Posts: 330
Question MYSQL tables question about how to do what I want to do

Hello all! I've been pondering this for months and even asked my previous college professor from Relational database class and he didn't have an immediate answer.

I work for a copier/printer repair business. Besides repair, we sell consumable supplies and equipment. We have a person that handles all of the service and parts on machines and a person that handles all of the consumables and equipment.

I'm trying to create a database that basically handles parts, consumables, and assets (equipment). I think I can figure out how to handle all of that except for one area. When we buy a piece of equipment, I want it in our inventory by model number showing how many we have of that model number with each item having a unique equipment id and being in an asset list so once it's sold we can track the machine throughout it's life.

When we sell that asset, we need to create a invoice. Well any of you that have followed me to this point know that I want to keep that machine as an asset but take it out of inventory and assign it to the person that bought it (temporarily because we may get it back in the future). In the future, it may come back into inventory as an end of lease machine or trade in. I want to be able to follow that machine until it goes into the dumpster and be able to track service on it.

How can I set up the tables so all 3 of our categories are easy to invoice but at the same time separate in a way?

Thanks!

Cory
Reply With Quote
  #2  
Old 7th November 2008, 09:01 AM
pete_1967 Online
Clueless in a Cuckooland
 
Join Date: Mar 2006
Location: Here now, elsewhere tomorrow.
Posts: 3,948
Basic way:

For tracking the assets, create a table that has status codes (e.g. 'l' for lease, 's' for sold, 'd' for discarded etc) and add its primary key as foreign key in your equipment table.

Create customer table and lookup table that links customer's id to equipment id (one customer may have many machines but one machine can only be kept by one customer)

Sort of this way:
Code:
table: appliance
--/id = 1
--/status_id = 1

table: status
--/id = 1
--/description = 'on lease'

table: cust
--/id = 1

table: customer
--/id = 1
--/cust_id  = 1
--/applicance_id = 1
Now when you need to find who has what, you query the lookup table by cust id and retrieve appliance ids which you then use to get appliance data.

For status, query should be rather straightforward since each appliance can have only 1 status at one time.

You can then update the lookup table when the appliance is returned for example.

Above is just quick example how you can do it so you may need to refine it but it shows you the principle. I think your professor must have misunderstood your question (or I am) and therefore couldn't give you an answer, or he shouldn't be doing his job.
__________________
A Drink is Not Just For Christmas - SaskyCom :thumb:


“Give a man a fish; you have fed him for today. Teach a man to fish; and you have fed him for a lifetime” so now go and...
RTFM FIRST: http://docs.fedoraproject.org/ & http://rute.2038bug.com/index.html.gz
Reply With Quote
  #3  
Old 7th November 2008, 04:25 PM
crainey69 Offline
Registered User
 
Join Date: Oct 2007
Location: Macon, MO
Age: 44
Posts: 330
ok thanks sounds good!
Reply With Quote
  #4  
Old 7th November 2008, 11:36 PM
ValHolla's Avatar
ValHolla Offline
Registered User
 
Join Date: Aug 2008
Location: St. Louis, MO
Age: 38
Posts: 83
I have used Fab Force's DB Designer to assist in creating databases in the past.
you may want to give it a look.

DB Designer 4
which has apparently been replaced by MySQL Workbench
MySQL WorkBench
__________________
"Any intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius -- and a lot of courage -- to move in the opposite direction."
  • Albert Einstein 1879 - 1955
    US German-born Theoretical Physicist
Reply With Quote
Reply

Tags
mysql, question, tables

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Preloading MySQL tables for livecd bugg_tb Using Fedora 1 20th February 2008 03:22 PM
MySQL upgrade hosed existing tables... SHtRO Installation and Live Media 3 11th May 2006 01:21 AM
MySQL: Can't open privilege tables: Incorrect information in file: './mysql/host.frm' benjamin.choi Servers & Networking 1 25th June 2005 04:19 PM


Current GMT-time: 06:51 (Tuesday, 18-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat