views:

43

answers:

1

This car dealer company has many branch offices. In each of these branch offices, some sales people are working whose job is selling cars to customers. You need to define your branch offices in your diagram. And also, you need to define sales people who are working in these branch offices. - This company sells cars, so you must store car manufacturer information in your database. Design a suitable model for storing car manufacturers in your diagram. - These manufacturers produce vehicles. Each vehicle must be associated with a manufacturer. And you should also store features about vehicles such as production year, gearbox, fuel type, weight etc… Do not forget that possible car features can differ for each car, so storing them in a single entity will cause “null value” problem. Your design must eliminate this “null value” problem. - And lastly, you should define an inventory for available cars for each branch of the company. This inventory will keep track of which cars are available for selling from which branches.

+1  A: 

The informational stuff I leave to you, I don't know the application too good. Relationally, it could look like this:

  • Companies
    • Company information fields, such as name.
  • BranchOffices
    • company_id
    • Branche office information fields, such as address and telephone
  • SalesMen
    • branch_office_id
    • Personal info about salesmen
  • CarBrands
    • Brand information, name, year of founding etc.
  • CarBrands_Companies
    • car_brand_id
    • company_id
  • VehicleTypes
    • car_brand_id
    • Information about vehicle, probably serving as default for a vehicle of this type
  • Vehicles
    • vehicle_type_id
    • branch_office_id
    • Vehicle specific stuff, color, type of motor, stuff that differs from the info in VehicleTypes.

The inventory part should be done using querying the Vehicles joined with the BranceOffices.

Additionally, you could add Customers and many-to-many them to SalesMen and Vehicles.

And last but not least, don't hate me for not doing what you requested (i.e. drawing a diagram), this is a place where people help each other. Let this information get you started with drawing your own ERD. If the issue happens to be that you don't know what to do this with, look into the free MySQL Workbench package.

Pelle ten Cate