Top DevX Stories
Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > Database

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 10-26-2009, 06:33 PM
SCass2009's Avatar
SCass2009 SCass2009 is offline
Registered User
 
Join Date: Oct 2009
Location: N. Ireland
Posts: 3
Question Database Design Help

First of all, hi to everyone and thanks in advance for any help!!!

problem is this - I'm creating a database/front end for a friend who runs his own computer business. He needs to store customer details as well as job details, ranging from repairs, data recovery, website design and so on. any database work i've done before has had one product or "job", so would each "job" here be stored in its own separate table, linked by another orders table

eg a customer books a data recovery job, all details of the job are stored in tblDataRecoveryJobs

tblCustomerDetails ---> tblJobs ---> tblDataRecoveryJobs
CustID JobID JobTypeID
CustID
JobTypeID

at first I had one giant table for jobs, with details of all types jobs being stored in it, although by going through the normalisation process wouldn't the one big table be broken down into the smaller ones anyways?

sorry if it sounds a bit confusing, any help at all is greatly appreciated
Reply With Quote
  #2  
Old 10-27-2009, 08:28 AM
Hack's Avatar
Hack Hack is offline
Super Moderator
 
Join Date: Apr 2007
Location: Sterling Heights, Michigan
Posts: 7,719
Quote:
Originally Posted by SCass2009 View Post
by going through the normalisation process wouldn't the one big table be broken down into the smaller ones anyways?
That would depend on what is being stored.

For its most basic definiation, normalization means no duplication. In other words, the same information is not store in more than one table.

There would be a job types table with each job type having its own job type code and the job type code would be what is stored in other table records relating to the individual job.
__________________
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista

Microsoft MVP 2005/2006/2007/2008/2009
Reply With Quote
  #3  
Old 10-27-2009, 01:27 PM
SCass2009's Avatar
SCass2009 SCass2009 is offline
Registered User
 
Join Date: Oct 2009
Location: N. Ireland
Posts: 3
so far i have a table for storing the job type, tblJobType, with JobType being the primary key. so for each job type, say data recovery, repairs, website development, I have a table for recording each of the details i.e.

tblDataRecovery
JobID <-- Primary Key
JobType <-- Foreign key
*rest of fields for containing information*

tblRepairs
JobID <-- Primary Key
JobType <-- Foreign key
*rest of fields for containing information*

So when a customer places an order/job, a table tblCustomerJobs would store the CustomerID, JobID and JobType... but isn't this is wrong, since JobID would have duplicates if each job table say started at "1" for JobID?
Reply With Quote
  #4  
Old 10-27-2009, 01:35 PM
Hack's Avatar
Hack Hack is offline
Super Moderator
 
Join Date: Apr 2007
Location: Sterling Heights, Michigan
Posts: 7,719
Ths various IDs are not data...they are pointers to data.

The actual data would be the job description and that should be in only one table, with the corresponding jobid being in whatever tables would be appropriate.
__________________
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista

Microsoft MVP 2005/2006/2007/2008/2009
Reply With Quote
  #5  
Old 10-27-2009, 02:34 PM
SCass2009's Avatar
SCass2009 SCass2009 is offline
Registered User
 
Join Date: Oct 2009
Location: N. Ireland
Posts: 3
sorry, my fault for not explaining what I meant properly

what I mean is say in tblDataRecovery, JobID would be"1" for the first record, then "2" for the next, but then in tblRepairs JobID would also be "1" for the first record, "2" for the second and so on

so if I have a table tblCustomerInvoice, with CustomerID and JobID, how would I do the relationships since the JobID in tblCustomerInvoice would be linking to JobID in several tables

sorry, just most the databases I've done before have been one job or product type, this is the first time I've attempted one with several different jobs!
Reply With Quote
  #6  
Old 10-29-2009, 08:50 AM
Hack's Avatar
Hack Hack is offline
Super Moderator
 
Join Date: Apr 2007
Location: Sterling Heights, Michigan
Posts: 7,719
Don't auto number the JobIDs - assign them.

In other words,

"Build Wall" would have an assigned JobID 0001
"Build Sidewalk" would have an assigned JobID of 0002
etc

The job descriptions in all other tables would simply have 0001 or 0002 or whatever
__________________
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista

Microsoft MVP 2005/2006/2007/2008/2009
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Database not properly created Arjuna Database 2 07-25-2007 04:22 AM
design database table for survey form darkestsky Database 1 10-15-2005 03:07 PM
database design description rdl VB Classic 0 12-27-2001 02:59 PM
Database design for database enabled web site Nick VB Classic 1 12-14-2000 03:59 PM
Client/Server database design Leedo Leedo VB Classic 0 03-20-2000 12:49 AM


All times are GMT -4. The time now is 10:53 PM.


Sponsored Links



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.