• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Another SQL problem...

 
Amy Phillips
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an instructor table where each instructor has a unique ins_id, there is also a mentor_id column which allows instructors to mentor other instructors. This is show by having the ins_id of the mentoring instructor in the mentor_id column
sort of like:
ins_ID Mentor_ID
1 -
2 -
3 2
4 2
5 3
The problem is I need to show the average number of instructors per mentor but am a bit lost on how to do this.
I am guessing something like counting the number of occurences each instructor has in the mentor field and dividing it?
If anyone has any ideas I would be very grateful
Thanks
 
David Peterson
author
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you manage to get the previous problem sorted out?
Is this homework for a course?
 
Amy Phillips
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Yes the other solution worked a treat - thanks.
These are forming part of a database system so not exactly homework.
 
Amy Phillips
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its ok, I have finally worked out the solution - it turned out to be much more simple than I was trying to make it
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic