Hi i have the following table structure.
Professor (EMP ID,Name,Status,Salary,Age)
Course(Course ID,Course Name,Points)
Works(Course ID,EMP ID,Class ID)
I need to do the following.
Return List of Employees who have taken 2 different course M1 and M2 for the same class ‘class 10’
This is the query that i have written.
SELECT p.EmpID, p.Name, p.Status, p.Salary
FROM professor p, course c, works w
WHERE p.EmpID = w.EmpID
AND
w.CourseID = c.CourseID
AND
w.ClassID = 10
AND
c.CourseName IN ( SELECT CourseName FROM course WHERE CourseName = 'm1'
AND CourseName = 'm2')
But the query doesnot return any values even though there are data in the db.