Hi, im a newbi in conception of DB
Question, is better to put all model cars ex: lexus,audi,bmw... with model in one table or a table for each vendor ? for the future its more easy to work with one table or multiple.
Attachments: Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.
Answer by tonylodge · Oct 28, 2019 at 09:40 PM
I would recommend one table to store a list of vendors and one table to store the models, referencing the correct vendor via a foreign key.
Answer by deadreply · Oct 29, 2019 at 10:02 PM
@tonylodge Ok but can you explain why this method ? thanks
Sorry I wasn't very explanatory was I ?
It's all about good database design, you want each table to be a grouping of specific types of "things" or entities - could be customers, orders, in your case, cars etc.
So a vendor is a an entity, so is a car - hence seperate tables.
You don't want a different table for each car vendor because it would greatly complicate your queries when you want cars from more than one vendor, and it would mean adding a new table every time you added a vendor. You don't want to include vendor information in the car models table, because you will be repeating information.
It strikes me you could use some reading on the basics of database design. There are some good books out there but for a free starter I found this site:
Database structure and design
Hope this helps a little.
Answers Answers and Comments
18 People are following this question.
datagridview with checkbox
SQL SERVER 2014 database stuck in Recovering
how do you encrypt an entire SQL 2005 database?
DBCC Checkdb repair cmd not fixing errors