Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Databases SQL Reporting by Example Day 3: Getting Good at Grouping Most Popular Teacher

Most Popular Teacher4:28

Hi, I seemed to get the same answer to the solution worked question, but my query was different:

'''WITH ELEC_TEACHERS AS''' ( '''SELECT first_name, last_name, name, count(student_id) AS 'CT' FROM TEACHERS''' '''JOIN CLASSES ON teachers.id = classes.teacher_id''' '''JOIN SCHEDULE ON schedule.class_id = classes.id''' '''JOIN SUBJECTS ON subjects.id = classes.subject_id''' '''WHERE GRADE IS NULL''' '''GROUP BY teacher_id''' '''ORDER BY COUNT(student_id) DESC''' ) ''' SELECT first_name, last_name, MAX(CT) FROM ELEC_TEACHERS;'''

IS this okay?

https://teamtreehouse.com/library/most-popular-teacher

It's okay guys I have re-watched the video and it makes sense. You can just ignore this.

Thanks Mike

Patrik Horváth
Patrik Horváth
11,085 Points

can you edit it ? and post it in CODE because i m totaly LOST :(

Steven Parker
Steven Parker
218,596 Points

As Patrik said ... and also please provide a link to the course page you are working with.