DataBase design

I am creating a database for a driving school. I Need some idea about linking cars/instructors/locations.

So i thing I need to have a hub where I can store some cars. And the instructor get assigned to the car. Instructor can be assigner to many hubs as well as multiple locations. The question is do i better of assigning instructor to a particular location  or a car?
LVL 19
erikTsomikSystem Architect, CF programmer Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim HornSQL Server Data DudeCommented:
Just out of wild curiosity, if you 'need some idea', then how'd you get the job?
erikTsomikSystem Architect, CF programmer Author Commented:
I am not asking for idea, I am interesting on different opinions
Jim HornSQL Server Data DudeCommented:
Tell you what ... you paint us a picture as to why this question is not homework using words other than 'this isn't homework', and we'll cough up some opinions.

EE is a technical question and answer site, and not a homework site, so we can help you understand design concepts, or answer specific questions, but we're not about to flat-out do your homework for you.

My first opinion though is the questions you're asking are usually handled in the requirements analysis phase of a project, where developers will interview the business analyst and/or clients to ask details as to what they want built, so that design can begin.  It's dangerous for a developer to assume (ass-u-me) relationships between tables without a solid basis in requirements.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

Scott PletcherSenior DBACommented:
>> So i thin[k] I need to have a hub where I can store some cars. <<

Hmm, I would expect the vehicles (more generic, so I prefer it to cars, who says you can't teach someone to drive a truck or even a motorcycle at some point) to be stored at the locations.  Did the company owners / managers indicate something about a "hub" for vehicles of some sort?

Interesting.  You'll have to decide if you want to treat a "hub" as a type of location or as a completely separate entity from location.  Look at the attributes and properties and see how similar or dissimilar they are.

>> And the instructor get assigned to the car. <<

And location, yes.  But I'd put a date and time on this.  An instructor could certainly use different vehicles on the same day, even potentially in different locations (particularly since you could drive Student A from one location to another, then add Student B to drive back to the original location).

I'd definitely use separate, relationship tables for these vehicle/location, instructor/location, instructor/vehicle, etc., combinations rather than trying to put them in the base/"master" tables.
erikTsomikSystem Architect, CF programmer Author Commented:
The hub can also be a training location not just a storage.
Scott PletcherSenior DBACommented:
Then I'd definitely treat "hub" as just a subtype of a "location", i.e., just add a "location_type" to the location table to indicate location | hub | <whatever>.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.