Quiz
4. Task 3 - Aggregation and grouping

Instruction

A-ma-zing! Part 2 was no challenge for you! Take a look at our third task:

essay (id, person, topic, length, points)

We're now going to analyze essays written by various students. Each essay has an id, was written by a specific person, has a certain topic and certain length (expressed as the number of words). Each essay is given points (0-100).

There may be more than one essay written by the same person.

Exercise

Show students' names (column person) together with

  • the number of essays they handed in (name the column number_of_essays) and
  • their average number of points (name the column avg_points).

Show only those students whose average number of points is more than 80.

Stuck? Here's a hint!

Use the following template to help you build your query:

SELECT
  ... 
FROM ... 
GROUP BY ... 
HAVING ...;