I'm trying to design a database to represent cars (specifically: year, make, model, trim) for a car dealership application. Based on my understanding of the data, I've come up with the two database designs below:
Example data:
Year: 2013
Make: Nissan
Model: Murano
Trim: SL
I think the top design is more correct than the bottom design - but I'm not 100% sure.
The plan is that for every vehicle added into the car dealership's inventory, I would assign that inventory item a trim_id
(which would have details about the vehicle's standard features, options, etc.). The inventory item would then just need to select which options apply to it, specify odometer reading, condition, price, etc.
The model would also need to be able to support queries like:
- List all
make
for a particularyear
- List all
model
for a particularmake
- List all
trim
for a particularmodel
Is the design in the right direction? Normalized?
Database Design Cars-Models / Car Classifieds - this puts the year
column with the model
. I'm not a car buff, but I don't think this is right. I think the trim
is associated with the year
?