Lesson 8: Structuring query results

This documentation is not current - it is for TypeDB 2.x, which is no longer supported. View the documentation for TypeDB 3.x:

In this lesson, we’ll learn how we can modify our queries to retrieve results in more useful and efficient structures. We’ll see how we can directly retrieve attributes, how we can use subqueries to group results and perform aggregations, and finally how we can sort and paginate the results returned.

  • You should complete Lesson 7 before starting this lesson.

Lesson contents

Learn how to retrieve attributes via their owners or directly.

Learn how to group results using subqueries.

Learn how to aggregate results using subqueries.

Learn how to sort and paginate query results.

TypeQL keywords introduced

  • get

  • count

  • sum

  • max

  • min

  • mean

  • median

  • std

  • sort

  • asc

  • desc

  • limit

  • offset