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 > Auto data database design

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-02-09, 13:41
clemp clemp is offline
Registered User
 
Join Date: Apr 2009
Posts: 3
Auto data database design

Hello Everyone,

I look at an automotive sales report each month that lists number of cars sold by brand. The hierarchy of this data is as such:

Parent company -> Make -> Type -> Model

One 'parent company' (ex. GM) will have many 'makes' (ex Buick, or Cadillac, or Chevrolet, etc). One 'make' has one of two 'types' (car or truck), and for each type there are several models (1 Series, 3 Series, etc).

Each month I would like to add the new sales data when the report is issued.

I am wondering if I should create a new table for each parent company, and in the table have fields 'Make', 'Type', 'Model' and 'Sales'. Is this the most logical and efficient way to structure this data?

Any suggestions are more than welcome. I appreciate the help in advance.
Reply With Quote
  #2 (permalink)  
Old 04-02-09, 14:08
dportas dportas is offline
Registered User
 
Join Date: Dec 2007
Location: London, UK
Posts: 732
One table for all companies makes most sense because it avoids the possibility of redudant data and makes it much easier to analyse the data across all companies.

Last edited by dportas; 04-02-09 at 14:11.
Reply With Quote
  #3 (permalink)  
Old 04-02-09, 15:00
clemp clemp is offline
Registered User
 
Join Date: Apr 2009
Posts: 3
Thank you for the quick reply. So should I create the rows 'id', 'parent company', 'make', 'type', 'model', 'date' and 'sales' and create a new column each time the monthly data is released (to update the 'date' and 'sales' values)?

Much of the data will be the same every single month - 'parent company', 'make', 'type', and 'model' will never change. Is there a better way to structure this information, or is the way stated above the best for this type of job?
Reply With Quote
  #4 (permalink)  
Old 04-02-09, 15:23
dportas dportas is offline
Registered User
 
Join Date: Dec 2007
Location: London, UK
Posts: 732
Do you need to keep a history of the changes or just the latest data set? Either way you don't need to keep duplicating rows if they don't change - just have a ValidFrom date and a ValidTo date.

Sales I would expect to go in another table with a key that includes the date because that is presumably your history of previous months' sales.
Reply With Quote
  #5 (permalink)  
Old 04-07-09, 10:38
clemp clemp is offline
Registered User
 
Join Date: Apr 2009
Posts: 3
It is important that I keep a history of past sales data and the associated dates. Would it be smart to make four tables organized like so:

a 'parent company' table with 'parentID'
a 'make' table with 'makeID'
a 'model' table holding type and model information
a 'sales' table holding date and sales information

and connect them with the appropriate keys? Is there a better way to do this, or is this an acceptable, scalable design for this project?
Reply With Quote
  #6 (permalink)  
Old 04-07-09, 17:23
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
And, No. Do NOT create a new column each time a month is added. That would be a big mistake. Include the month in the table definition, and add a new record with the month and the sales data.
__________________
Lou
使大吃一惊
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert

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