Hi there,

I have these tables:

Skill (SkillID, Name)

Module (ModuleID, ModuleName)

ModuleSkill (SkillID, ModuleID)

Student (StudentID)

StudentModule (StudentID, ModuleID)


Basically each Student can take many Module.
Each Module can have many Skills

So I need to get the SkillName and ModuleName for each Student. For example, say a Module name "A" you can learn "Leadership, Time management and creative" skills then the table should return:

A - Leadership
A - Time management
A - Creative

Currently I am able to get SkillName with this query:

SELECT a.NAME, b.MODULENAME FROM Skill a, Module b WHERE a.ID in
(Select c.SKILLID FROM MODULESKILL c WHERE c.ID in
(Select ID FROM StudentModule WHERE StudentNo = 123))

however it's not getting me the ModuleName where the skill is learnt. So i did this query:

SELECT a.NAME, b.MODULENAME FROM Skill a, Module b WHERE a.ID in
(Select c.SKILLID FROM MODULESKILL c WHERE c.ID in
(Select ID FROM StudentModule WHERE StudentNo = 123))
AND b.ID in
(Select c.ID FROM MODULESKILL c WHERE c.ID in
(Select ID FROM StudentModule WHERE StudentNo = 123))


This query gets all the skills and module learnt by the student and repeats them. E.g. If the student learnt 3 module and learn 9 skills then it will return all the 9 skills for each module.

Sorry for bad grammar/english. I would really appreciate if someone could help me out with this problem.

Thanks in advance!!