Hi i have been trying to get the results for the code below and i can't seem toget myself around it. I need to get the results according to the myKad and Student Name on How many times the student has answered Excellent, Satisfaction and Poor for each question, each time they do the survey.
Table
_________
Student(id,name,mykad,...)
Customer Service(id, Q1,Q2,Q3)
Instructor(id, Q1,Q2,Q3)
Runner(id, Q1,Q2,Q3)
SELECT student.name, student.mykad,
COUNT(Q1) AS E,
COUNT(Q1) AS S,
COUNT(Q1) AS P
FROM customerservice
INNER JOIN student ON customerservice.id=student.id WHERE Q1='Excellent' AND yKad=student.myKad
INNER JOIN student ON customerservice.id=student.id WHERE Q1='Satisfaction' AND myKad=student.myKad
INNER JOIN student ON customerservice.id=student.id WHERE Q1='Poor' AND myKad=student.myKad
GROUP BY student.name, student.mykad