Database Schema for a boat

Reply

Join Date: Jun 2008
Posts: 1
Reputation: playah is an unknown quantity at this point 
Solved Threads: 0
playah playah is offline Offline
Newbie Poster

Database Schema for a boat

 
0
  #1
Jun 5th, 2008
Hi,

i am trying to come up with a schema for a databaes. It's been a while since I have done normalization on a schema, so I could use some help.

Situation:

There are boats.
A boat is build in a shipyard.
A shipyard has an owner.
A boat is bought by an owner.
When a boat is bought by an owner, I still need to see from which shipyard the boat was bought.

A fairly simple situation you might say, by maybe my head isn't clear.
I have attached a picture with a schema I came up with.

I don't think this schema is the best solution.

In this situation a shipyard has an owner (which is correct) and the owner has a boat (which is also corrcet). Also the shipyard has a boat (could be correct, if the boat is not sold yet).

I don't think I can easily get a query that can tell me if a shipyard is still the owner, or the boat has been sold.( of course it can be done with attributes).

What would you guys come up with as a schema. I have another schema, but will not show so I don't blur your minds.

thanks
Attached Thumbnails
dbs.gif  
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 296
Reputation: tesuji is on a distinguished road 
Solved Threads: 42
tesuji tesuji is offline Offline
Posting Whiz in Training

Re: Database Schema for a boat

 
0
  #2
Jun 7th, 2008
Hi playah,

your data model seems to be able to answer almost all questions you have asked. Also this one: Are there owners who own both, boats and shipyards? select owner.name, shipyard.name, boat.name from owner join shipyard on owner.onwerID = shipyard.onwerID join boat on owner.onwerID = boat.onwerID;

If you want to find whether a boat still belongs to the shipyard because of not having been sold so far, one solution would be to distinguish between both sorts of owners, for example by adding a category attribute to the owner entity, say category {'private individual', 'shipyard company'}. Then the select may look like this one: select owner.name, boat.name from owner join boat on owner.ownerID = boat.ownerID where owner.category = 'shipyard company';

Another data model might be based on ERM generalization/specialization (isa-relationships), where you would have one common owner entity for generic data and two sub categories (specializations) to hold specific data on private boat owners and shipyards on the other hand.

krs,
tesu
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Database Design Forum
Thread Tools Search this Thread



Tag cloud for Database Design
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC