A real life example of database design by Eduardo Bellani
In a followup to How to use the relational model to do database design?, I was asked to provide an example to illustrate the point:
Can you walk through a real life example of modelling, let’s say, a car (it’s always a car isn’t it?).. Consider that the car may have 2WD, 4WD and also let say we allow truck types of cars with 6 wheels. Cars have various engine types and depending on the model of car, some colours are available and some are not. How would you apply the logical design to this idea and where would such a design lead you if you were to implement it into the physical world?
Here is a list of predicates that provide such an example:
- There exists car of models
$MOD
- Cars can have transmission
$TRA
- Cars can have engines
$ENG
- Cars can have colors
$COL
- Model
$MOD
can have color$COL
- Model
$MOD
can have engine$ENG
- Model
$MOD
can have transmission$TRA