Friday, 6 September 2013

MySQL Query assistance - I'm baffled

MySQL Query assistance - I'm baffled

Wondering in anyone can assist me with a couple of queries which have
cropped up in a project. The project is a database of people and their
attendance of training courses.
There are a few tables...
Users (with UserID and Username)
Teachers (with TeacherID and TeacherName)
Courses (with CourseID, CourseName, CourseDate and TeacherID) - this one
relates to which teacher took which course
Attendances (with UserID and CourseID) - this one relates which user
attended which course
What the client is after is firstly selecting all the users who have NOT
attended a specific teachers' courses. In other words, if the have been on
a course with the specified teacher, they will not be shown.
Secondly, the client wants the same query as the first but also limiting
it to the last 6 months. In other words, selecting all the users who have
NOT attended a specific teachers' courses within the last six months.
This one has got me a bit baffled so any assistance would be appreciated.
Rik

No comments:

Post a Comment