Logic and Syntax Help - Count

Given 3 tables: COURSES, REQUESTS, CLASSROOMS joined properly in the
model (hopefully).

I want to either:

1) show all courses, but prohibit (onclick) enrollment in a course
based on its classroom reaching capacity (static value in table per

Or, 2) do not show courses that have reached their classroom capacity
through enrollment.

So, I think I have to count all requests for a given course, then show
courses whose requestcount is <= classroom.capacity.

Can anyone point me in the right direction on how to do this, and/or
provide feedback on my logic? I'll provide more details and code if
you might find it useful...

Thanks in advance........