Quiz
4. Task 3: Aggregation and grouping

Instruction

A-ma-zing! That 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 is of a certain length (expressed as the number of words). Each essay is given a certain number of 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 NumberOfEssays).
  • Their average number of points scored on these essays (name the column AvgPoints).

Show only those students who scored higher than 80 on average.

Stuck? Here's a hint!

Use the following template to help you build your query:

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