1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate SQL

Exercise

Filter with HAVING

Your final keyword is HAVING. It works similarly to WHERE in that it is a filtering clause, with the difference that HAVING filters grouped data.

Filtering grouped data can be especially handy when working with a large dataset. When working with thousands or even millions of rows, HAVING will allow you to filter for just the group of data you want, such as films over two hours in length!

Practice using HAVING to find out which countries (or country) have the most varied film certifications.

Instructions

100 XP
  • Select country from the films table, and get the distinct count of certification aliased as certification_count.
  • Group the results by country.
  • Filter the unique count of certifications to only results greater than 10.