Skip to content
Advertisement

SQL – listing members on enrolled classes

I am trying to figure out why this isn’t working. I am trying to select each member’s names and the classes that each member is enrolled on together with the class trainers name.

This is what I have at the minute:

Any help or tips would be appreciated as I am still learning SQL.

Extra info:

  • enrolment table has columns entrolmentID, memberID and classID
  • trainer table has columns trainerID and trainerName
  • member table has memberID, firstName, lastName, age, trainerID
  • class table has classID, className, _day and trainerID

Advertisement

Answer

The valid syntax for a JOIN statement is:

So in your case, use:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement