Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>I need some help in correctly setting up my tables. I've never had these kinds of requirements before so here it goes.
>
>Let's say I need to setup a system to store different characteristics of an automobile. Let assume I want to store info. on all possible combinations of TYPE (car, van, truck), COLOR (blue, black, etc.), TRANSMISSION (auto, 5-speed, etc.) and DOORS (4-door, 2-door, etc.).
>
> snip...
You then should have 5 tables theorectically...
CARS, TYPE, COLOR, TRANSMISSION, DOORS.
I practice you may find that many of the characteristics have the attributes simply of Code, Description and Price
So you can have just two tables.
CARS, CHARACTERISTICS
It really depends on how well the different characteristics can be mapped onto each other. That is do they share a common set of attributes, such as description, price etc.
If you anticipate the system growing and more complex and different things happening with the characteristics, eg. transmission may have a supplier but color may not (although there are paint companies...) then stick with the strict model and have 5 tables.
HTH
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement