If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Car service - domain model?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-13-11, 05:31
BojanSM BojanSM is offline
Registered User
 
Join Date: Oct 2011
Posts: 1
Angry Car service - domain model?

First of all I know that there is no Car, Model, Manufacture... tables that I probably should make, but that is not a problem right now.

I must say that I have already made database and relational model looks like this (I simplified it, to concentrate on important), but I need to draw a conceptual (domain) model of this:

Client (clientID, name, surname, telephone)

Address (clientID, number, street, cityZipCode)

City (cityZipCode, cityName)

Visit (clientID, visitDate, totalPrice)

Service (serviceID, serviceName)

Criteria (criteriaName, size, measureUnit)

ServicePriceCriteria (serviceID, criteriaName, size, price)

VisitItem (clientID, visitDate, serviceID, criteriaName, size, quantity)

My the biggest problem was how to provide that ONE service can have different prices for different criteria.

i. e. Oil Changes for the truck costs 15€. For suv same service costs 8€.... Other example is when price depends on the size of the wheel. For 14 inches wheel some service costs 10€ and the same service for 17 inches wheel costs 15€.

So for the first example I have: Service(123, 'Oil Changes'), Criteria('typeOfVehicle', 'Truck', null), ServicePriceCriteria(123, 'typeOfVehicle', 'Truck', 15)

Service(123, 'Oil Changes'), Criteria('typeOfVehicle', 'SUV', null), ServicePriceCriteria(123, 'typeOfVehicle', 'SUV', 8)

For the second example it looks like this: Service(124, 'Some Service'), Criteria('Size of wheel', '14', inches), ServicePriceCriteria(124, 'Size of wheel', '14', 10)

Service(124, 'Some Service'), Criteria('Size of wheel', '17', inches), ServicePriceCriteria(124, 'Size of wheel', '17', 15)

I hope so you realized what was my idea. I wanna to ask you is this solution acceptable at all? And is it domain model from atachment correct domain model of this database?
Attached Thumbnails
Car service - domain model?-conceptual.png  

Last edited by BojanSM; 10-13-11 at 05:33. Reason: I forgot to mark foreign key.
Reply With Quote
  #2 (permalink)  
Old 10-18-11, 22:58
optimus203 optimus203 is offline
Registered User
 
Join Date: Oct 2011
Location: Connecticut
Posts: 3
I'm just learning too, so this might not be an appropriate solution. How about using supertype and subtypes with discriminators?
Reply With Quote
Reply

Tags
conceptual model, database design, database desing

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On