Sample Header Ad - 728x90

Vehicle database design - Type, Make, Model, Vehicle

0 votes
2 answers
6902 views
I kindly ask you for advice, if I am correct with my DB design. I am writing an app in Django (it has its own ORM), which will use PostgreSQL. My expectation is, that I will specify: - Type (example: Automobile, Motorcycle, Boat, ...) - Make (example: Honda, BMW, Audi, ...) - Model (example: CBR1000, A6, A8, 535i, ...) - Vehicle - all other info, like VIN, price, ... So I think that the best way is to have Makes unique. I don't know, what to do with a **Type**. I think that the best way is to have a foreign key of a Type in a Model - because for example **Honda** can produce **Automobiles** and also **Motorcycles**. So by **Model** we can found, what vehicle type is it. I want to make a web form filter (some kind of three linked dropdowns), where the user will select a **Type**, then it will filter out all **Makes** for that selected type. Then in another dropdown, he will select a Make and in the third dropdown, there will be shown all Models, which is available in that selection. Something like a Copart has - Vehicle Finder on the right side of web page https://www.copart.com/vehicleFinder/ I hope that it makes sense, I have created a schema like this, and I am not just sure if it is usable and it is right. Here it is: vehicle database schema link to editor: https://dbdesigner.page.link/gS62T3GYPth2TAAbA Thank you very much for any advice!
Asked by saby (105 rep)
Dec 2, 2020, 05:21 PM
Last activity: Apr 29, 2023, 03:00 AM