{
  "id": "django-aggregation-table",
  "kind": "table",
  "slug": "django-aggregation",
  "iil_id": null,
  "note_url": "https://iinventedlight.com/library/notes/django-aggregation/",
  "title": "Summarize a Django QuerySet with aggregate() or annotate()",
  "columns": [
    "name",
    "source",
    "detail"
  ],
  "rows": [
    {
      "name": "aggregate()",
      "source": "Django docs",
      "detail": "Summary values over an entire QuerySet"
    },
    {
      "name": "annotate()",
      "source": "Django docs",
      "detail": "Per-object summary such as Count"
    },
    {
      "name": "Avg",
      "source": "Django docs",
      "detail": "avg(); NULL if there are no non-NULL inputs"
    },
    {
      "name": "Count",
      "source": "Django docs",
      "detail": "count() over a group of rows"
    }
  ],
  "related_slugs": [
    "django-querysets",
    "django-models",
    "sqlite-query-planner-indexes"
  ],
  "license": "CC-BY-4.0",
  "source_license": "BSD-3-Clause (Django docs); Public-Domain (SQLite); prose restates cited source lines in own words",
  "as_of": "2026-11-19",
  "status": "deep-draft-20261119",
  "note": "Restated from the note's GREEN sources; check those sources before relying on a value."
}