Click here to Skip to main content
14,825,842 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi fellows,
I am stuck, I have two questions. First, if the tables relationships are right. Second,I want to allow a part can be used for many models/engines. For instance, 2001 Honda, Accord and 2002 Honda accord Engines 1.6 can have the same alternator.

VehicleType
-ID
-Name

Make
-ID
-Year
-Name
-VehicleTypeID

Model
-ID
-MakeID
-Name

Engine
-ID
-ModelID
-Name

Product
-ID
-CategoryID
-Name
-Description

ProductEngine
-ProductID
-EngineID

Category
-ID
-Name
Posted

1 solution

We can't really answer that based on that - we have no idea what relationships you have established, or are going to establish.
We can assume a relationship exists from the name, but that doesn't tell us what type of relationship it is - and that's important. A one-to-many relationship is not the same as a one-to-one for example.

We also don't know exactly what you are trying to do with the data:
For example, a 2013 Honda Accord 1600 could have the same or a different engine to the 2014 Honda Accord 1600, but the engines could share the same alternator, even if they are different, or have different alternators, even if they are the same. Is that important in your system? I don't know, I have no idea what your project entails.

I'd suggest that you sit down and try some sample data, including every variation you need to accept and check that the scheme you have designed can accommodate it - it's a PITA job, but it needs to be right from the beginning as any mistake or omission here have have far reaching consequences.

Probably, you need to consider the cars as a set of sub-assemblies, each of which is comprised of further sub-assemblies: so that the body trim sub-assembly for a "L" model can be similar-but-different from the body trim sub-assembly for a "GL" model, even if they share identical engines.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900