Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Travis Williams
5,678 PointsWhen was the HAVING keyword covered in the Beginning SQL Learning Track?
This lesson is near the end of the current Beginning SQL learning track, and I don't remember ever encountering the HAVING keyword. Was this covered in the track?
I went back through my notes and the SQL Cheatsheets on GitHub and found 1 instance of it in the Reporting With SQL cheatsheet but I don't remember it being used in a lesson and there wasn't much of an explanation of it on the GitHub page.
I worked out my own solution using a CTE since those were covered in the learning track.
WITH classes_taught AS(
SELECT * FROM CLASSES
JOIN TEACHERS ON CLASSES.TEACHER_ID = TEACHERS.ID
GROUP BY TEACHER_ID
)
SELECT FIRST_NAME, LAST_NAME, PERIOD_ID AS 'Count of Classes' FROM classes_taught
WHERE PERIOD_ID = 7;
It can be frustrating as a student to see the solution presented with new material instead of building on what was already covered, but I understand that there are multiple tracks and lessons can belong to many learning areas.
I still think this is an amazing resource and is staffed and supported by a great community. Thank you!