Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 6th, 2003, 12:36 PM
jennyhc jennyhc is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 9 jennyhc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Database design

I am a begginer and im trying to do a car dealership website. the website would show the cars the dealer has and allow the dealer to go online to add and delete caras as they get sold and the client to look upall the cars ( with pictures fromthe dealer )
i just need help with the logic for designing the databse.
im using ASP // Access todo it.
the problem is im coming up with too many tables andi dont knw if i should relate them all to each other . i want to have main categories defined by truck brand. but then i have tables for Air condigioining ( yes , no ) transmission ( auto , 4 5 6 speed ) brand name ( toyo, mitsu, and nine more ) truck models. chassis lengh, chassis height, engine size, etc. i dont know if i should combine more of this tables together or what s the best way to go . If any of you master gurus could help me i'd be thankful .

Reply With Quote
  #2  
Old October 9th, 2003, 12:40 PM
binky's Avatar
binky binky is offline
Gerbil
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Oct 2001
Location: In a Rotastak
Posts: 1,763 binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 22 h 12 m 52 sec
Reputation Power: 18
To make it easier you definitely need to remove a few tables. A table that simply has a yes/no value can be removed (air-conditioning), all you need is a field to represent the yes/no option. Transmission also should be a field in the cars table and not a separate table.

In the simplest form you need:

Manufacturer
Model


And that's it... especially with a web-based system, as the forms can handle the task of look-up tables.
__________________
- Sorted!

www.ppfuk.com - Free Photo Sharing

Reply With Quote
  #3  
Old October 9th, 2003, 06:31 PM
jennyhc jennyhc is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 9 jennyhc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
database design HELP !

Thank you for your help binky . im a beginner so im really overwhelmed with all this design stuff.
I am attaching a copy of my database so you or any one who wants to give an opinion can see it.

the requriements for the website are these:

Admin needs to be able to:

Add cars to database
delete cars from database
Update cars in database

be able to add new brands to the brands table. or new models to the models table.

In the add or delete cars there will be dynamic drop down menus so that the admin. can easily and with no mistakes update cars to the database.

The customers need to be able to:

-search cars through one main category which will be Brand names. so that if he hits on one link this will automatically load all -the cars of that brand into the page.
-after that page he will click on a link for the car he likes and see more details for that car
I hope I am not too confusing.
Thanx to everyone for all your help
My database file is attached for all to see and give me their opinion
Attached Files
File Type: zip truck database.zip (49.8 KB, 278 views)

Reply With Quote
  #4  
Old October 10th, 2003, 02:26 AM
Zippygoose's Avatar
Zippygoose Zippygoose is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Spokane Washington
Posts: 7 Zippygoose User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Zippygoose
A quick tip about database design that helps a lot, especially for those just getting started, is to start out simple. After briefly looking at your setup, I would begin with just two tables: Manufacturer and Accessories. I haven't used access much but i'm pretty sure it will create a primary key column for you on the creation of any new table unless you tell it not to. Start out with you manufacturer's table holding the car's make and model (these will be your columns), then relate your manufacturer's table to the accessories table (which will hold info on the car) Each car you have at the dealership should have its own unique key to differentiate itself from any other car. This way you can have a row in the accessories table for each specific car. From there, add columns to the accessories table for whatever you need i.e. AC, transmission, power windows, etc. etc. I hope this helps and makes any kind of sense (it's pretty late!).

Reply With Quote
  #5  
Old October 10th, 2003, 09:54 AM
jennyhc jennyhc is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 9 jennyhc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thank you zippy goose. the problem i see by combining the the manufacturer's and model's table is that one manufacturer can have several models and so when i have to query this from my webpage then i would have to use a bunch of different queries because the manufacturers and models are in the sam table . i dont know if i explain myself right.

Table manufacturers/models

TableID manufacturers Models
1 toyota camry
2 mitsubishy eclipse
3 honda accord
4 toyota celica
5 honda civic
6 honda prelude
7 toyota supra.



you see what i mean ? but if i use to different tables and join them like this .

manufacturers---------= models



then i could have



manufacturereID manufacturer
1 honda
2 toyota

modelsID model manufacturerID (foreign key from manuf)
1 civic 1
2 camry 2
3 prelude 1
4 celica 2
5 supra 2
6 accord 1


yoyu see.. ? can u give me ur opinion ?

Reply With Quote
  #6  
Old October 10th, 2003, 11:10 AM
jcelko jcelko is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Salt Lake City
Posts: 10 jcelko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 22 m 23 sec
Reputation Power: 0
You might want to look for a package instead.

NOTES ON VIN:
In North America, a system is used that is far more stringent than the ISO Standards but is "backward compatible." Here, the VIN is divided into four sections:

The first three characters shall uniquely identify the manufacturer, make and type of vehicle (with the same exception of manufacturers that produce less than 500 vehicles). Effectively, this is the WMI. There are indeed examples of manufacturers who have more than one WMI that use the third character as a code for a vehicle category (for instance bus or truck). Just as often however this is not the case;

The second section consists of five characters (VIN positions 4-8) and identifies the attributes of the vehicle. For each type of vehicle (passenger cars, MPV's, trucks, buses, trailers, motorcycles, incomplete vehicles other than trailers), different information is required. For cars, MPV's and light trucks it is required that the first two characters of this section are alphabetic, the third and fourth shall be numeric and the fifth alphanumeric. This section is the VDS in ISO 3779 but there it comprises another position of the VIN;

The third section consists of one character which is the check digit, calculated over the other 16 characters of the VIN. This character can be numeric or the letter X;
The fourth section consists of eight characters on positions 10-17 of the VIN. The last five shall be numeric for cars, MPV's and light trucks and the last four shall be numeric for all other vehicles. The first character represents the vehicle model year, the second character represents the plant of manufacture. The third through eighth characters are a sequential production number (for manufacturers producing more than 500 vehicles per year). For other manufacturers, the sixth, seventh and eight positions represent the sequential production number.

This section confirms to the VIS in ISO 3779.

A portion of the VIN is the WMI (World Manufacturer Identifier) Code. SAE assigns this code to U.S. vehicle manufacturers. If you are a U.S. manufacturer, please contact:

Cathy Douds
WMI Coordinator
SAE International
400 Commonwealth Drive
Warrendale, PA 15096-0001
724.772.8511
724.776.4026 - fax
douds@sae.org

Related Standards:

There are several standards available on VINs and WMIs:

SAE - J187 - Truck Vehicle Identification Numbers
SAE - J218 - Passenger Car Identification Terminology
SAE - J272 - Vehicle Identification Number Systems
SAE - J273 - Passenger Car Vehicle Identification Number System
SAE - J853 - Vehicle Identification Numbers
SAE - J1108 - Truck and Truck Tractor Vehicle Identification Number Systems
SAE - J1044 - World Manufacturer Identifier
SAE - J1229 - Truck Identification Terminology
SAE - J1877 - Recommended Practice for Bar-Coded Vehicle Identification Number Label


SAE J129 - Engine and Transmission Identification Numbers
ISO 3779 - Road vehicles - Vehicle identification number (VIN) Content and structure
ISO 3780 - Road vehicles - World manufacturer identifier (WMI) code

Reply With Quote
  #7  
Old October 10th, 2003, 11:55 AM
binky's Avatar
binky binky is offline
Gerbil
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Oct 2001
Location: In a Rotastak
Posts: 1,763 binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 22 h 12 m 52 sec
Reputation Power: 18
You say that you're a beginner, but yes, you're right... If you had Honda Prelude and Honda Civic, for example, in a single manufacturer/model table you are getting data redundancy. Honda appears twice, and if you store contact details for your Honda supplier then you will be storing all that data twice. Two things happen here, one is that it makes for getting errors. People enter Honda one time, then honda the next... the lowercase 'h'may make all the difference. The other problem is that the database gets bloated and searches take longer.

The next stages that you detailed are better placed in the ASP forum, or have a look at the following:

http://www.w3schools.com

It should help you a lot with the project.

Reply With Quote
  #8  
Old October 10th, 2003, 02:31 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,843 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 22 h 48 m 43 sec
Reputation Power: 766
Nice to see you here, jcelko. Thanks for the detailed explanation!

Reply With Quote
  #9  
Old October 10th, 2003, 03:36 PM
Zippygoose's Avatar
Zippygoose Zippygoose is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Spokane Washington
Posts: 7 Zippygoose User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Zippygoose
Yeah, the model you made looks good, now you can make an accessories table and use your keys to relate the two. I'm assuming that the ModelID column is the unique key for each car? After reading jcelko's post, however, I would take his advice and look into using the VIN numbers. Making your own model is great, but car manufacturer's usually don't cater to us DB folks that well . When building the DB structure for a test equipment reseller, I was going crazy sometimes because there are sooo many different manufacturer's, product ID's, product names, and accessory parts, none of which relate at all to each other because they are all from different companies! I feel your pain, but yeah, look into the VIN stuff that seems like a good, scalable idea.

Last edited by Zippygoose : October 10th, 2003 at 03:38 PM.

Reply With Quote
  #10  
Old October 12th, 2003, 08:34 PM
jennyhc jennyhc is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 9 jennyhc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
did you guys check the database attachment i posted prviously? what do you think ?

Reply With Quote
  #11  
Old October 12th, 2003, 10:37 PM
jennyhc jennyhc is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 9 jennyhc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Database design Help

hey guys . i thoought I'd put all the fields i Came up with so you guys cn tell me what would be the wisest way to relate them and group them into tables. :

the fields are:

Stock number (unique identifier for every car)
car manufacturer
car model
transmission type
car height
car length
engine type
radio (yes or no value )
A/C (yes or no value )
Price
warranty info
Mileage
VIN
Gross Vehicle weight
Wheel Base
Big image
Small Image
Image height
Comments from dealer
Extras


I have them separated into :

----------------------------------
Inventory table :
InventoryID
StockNumberID
TruckID (foreign key)
ModelID(foreign key
Air
CDL
EngineID(foreign key)
Lift
Radio
TranID(foreign key
Height ID (foreign key
LenghtID (foreign key
WarrantyID (foreign key
Price
GrossVehicleWeight
VIN
Mileage
WheelBase
Extra
SmallImage
BigImage
ImageHeight
Comment
---------------------
Table Engine
EngineID
EngineType
----------------------------------
Table Truck Manufacturer
TruckID
Brand
----------------------------------
Table Truck model
ModelID
ModelName
TruckID
-------------------------------------
Table Transmission
TranID
TranType
---------------------------------------
Table Truck Height
HeightID
Height
-------------------------------------
Table Truck lenght
LenghtID
HorizontalLenght
------------------------------------
Table Warranty
WarrantyID
warrantyinfo
----------------------------

Reply With Quote
  #12  
Old October 13th, 2003, 11:20 PM
jennyhc jennyhc is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 9 jennyhc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
HELP!!

Can somebody take alook at my fields in my last post above? and tell me if my tables are correct?

Reply With Quote
  #13  
Old October 14th, 2003, 11:49 PM
binky's Avatar
binky binky is offline
Gerbil
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Oct 2001
Location: In a Rotastak
Posts: 1,763 binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 22 h 12 m 52 sec
Reputation Power: 18
Let me see... Theoretically yes, but it seems way too confused.

Take it down to a basic level.

truck_table
--------------
truck_id
model_name
manufacturer_id

manufacturer_table
------------------------
manufacturer_id
manufacturer_name
contact details etc.

okay... very basic... assuming the same engine types are used for different truck makes you can add engine_id to the truck_table, and add the following tables:

engine_table
----------------
engine_id
eng_man_id
bhp
torque
etc.

eng_man_table
-------------------
eng_man_id
manufacturer_name
contact details etc.

So we now have the engine types and engine manufacturers in tables. I suppose warranties are interchangable, so add warranty_id to the truck_table and add the following table:

warranty_table
-------------------
warranty_id
warranty_details etc..

Now, your height, length and transmission tables seem irrelevent as they would likely only have the id field and one other field. They may as well be included in the truck_table as height, length and transmission. I know some people will express the virtues of look-up tables, but your web form select box can act as a look-up table for the transmission etc.

And that should be that.

Reply With Quote
  #14  
Old October 15th, 2003, 10:15 PM
jennyhc jennyhc is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 9 jennyhc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thank you binky for your help. i really appreciate it .

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > Database design


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread