{"id":6445,"date":"2023-01-19T03:31:23","date_gmt":"2023-01-19T03:31:23","guid":{"rendered":"https:\/\/www.pythontutorial.net\/?page_id=6445"},"modified":"2023-01-19T03:54:11","modified_gmt":"2023-01-19T03:54:11","slug":"django-aggregate","status":"publish","type":"page","link":"https:\/\/www.pythontutorial.net\/django-tutorial\/django-aggregate\/","title":{"rendered":"Django Aggregate"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn how to use Django to get the aggregate values from the database including count, min, max, sum, and avg.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='preparing-data'>Preparing data <a href=\"#preparing-data\" class=\"anchor\" id=\"preparing-data\" title=\"Anchor for Preparing data\">#<\/a><\/h2>\n\n\n\n<p>We&#8217;ll use the <code>Employee<\/code> and <code>Department<\/code> models from the <code>hr<\/code> application for the demonstration. The <code>Employee<\/code> and <code>Department<\/code> models map to the <code>hr_employee<\/code> and <code>hr_department<\/code> tables:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"374\" height=\"144\" src=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/01\/django_orm_employee_department.png\" alt=\"\" class=\"wp-image-6416\" srcset=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/01\/django_orm_employee_department.png 374w, https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/01\/django_orm_employee_department-300x116.png 300w\" sizes=\"auto, (max-width: 374px) 100vw, 374px\" \/><\/figure>\n\n\n\n<p class=\"note\">To start the tutorial, you can <a href=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/01\/django_orm_7_1.zip\" target=\"_blank\" rel=\"noreferrer noopener\">download the project source here<\/a> and follow these steps:<\/p>\n\n\n\n<p>First, add the <code>salary<\/code> field to the <code>Employee<\/code> model:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">Employee<\/span><span class=\"hljs-params\">(models.Model)<\/span>:<\/span>\n\n    salary = models.DecimalField(max_digits=<span class=\"hljs-number\">15<\/span>, decimal_places=<span class=\"hljs-number\">2<\/span>)\n    <span class=\"hljs-comment\"># ...<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Second, <a href=\"https:\/\/www.pythontutorial.net\/django-tutorial\/django-migrations\/\">make migrations<\/a> using the <code>makemigrations<\/code> command:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"> python manage.py makemigrations<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">Migrations <span class=\"hljs-keyword\">for<\/span> <span class=\"hljs-string\">'hr'<\/span>:\n  hr\\migrations\\<span class=\"hljs-number\">0005<\/span>_employee_salary.py\n    - Add field salary to employee<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Third, propagate the changes to the database by running the <code>migrate<\/code> command:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">python manage.py migrate<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">Operations to perform:\n  Apply all migrations: admin, auth, contenttypes, hr, sessions\nRunning migrations:\n  Applying hr<span class=\"hljs-number\">.0005<\/span>_employee_salary... OK<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Finally, populate values into the <code>salary<\/code> column with the data from <code>data.json<\/code> fixture:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\">python manage.py loaddata data.json<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"note\"><a href=\"https:\/\/www.pythontutorial.net\/wp-content\/uploads\/2023\/01\/django_orm_7_2.zip\" target=\"_blank\" rel=\"noreferrer noopener\">Download the complete project source code here.<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-the-django-aggregate'>Introduction to the Django aggregate <a href=\"#introduction-to-the-django-aggregate\" class=\"anchor\" id=\"introduction-to-the-django-aggregate\" title=\"Anchor for Introduction to the Django aggregate\">#<\/a><\/h2>\n\n\n\n<p>An aggregate function accepts a list of values and returns a single value. The commonly used aggregate functions are count, max, min, avg, and sum.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='count'>Count <a href=\"#count\" class=\"anchor\" id=\"count\" title=\"Anchor for Count\">#<\/a><\/h3>\n\n\n\n<p>The <code>QuerySet<\/code> object provides you with the <code><code>count()<\/code><\/code> method that returns the number of objects it contains. For example, you can use the <code><code>count()<\/code><\/code> method to get the number of employees:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-meta\">&gt;&gt;&gt; <\/span>Employee.objects.count()\nSELECT COUNT(*) AS <span class=\"hljs-string\">\"__count\"<\/span>\n  FROM <span class=\"hljs-string\">\"hr_employee\"<\/span>        \nExecution time: <span class=\"hljs-number\">0.002160<\/span>s &#91;Database: default]\n<span class=\"hljs-number\">220<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>count()<\/code> method uses the SQL <code><a href=\"https:\/\/www.postgresqltutorial.com\/postgresql-aggregate-functions\/postgresql-count-function\/\" target=\"_blank\" rel=\"noreferrer noopener\">COUNT(*)<\/a><\/code> function to return the number of rows in the <code>hr_employee<\/code> table.<\/p>\n\n\n\n<p>To get the number of employees whose first names <a href=\"https:\/\/www.pythontutorial.net\/django-tutorial\/django-orm-like\/\">start with<\/a> the letter <code>J<\/code>, you can use both <code>filter()<\/code> and <code>count()<\/code> methods of the <code>QuerySet<\/code> object like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-meta\">&gt;&gt;&gt; <\/span>Employee.objects.filter(first_name__startswith=<span class=\"hljs-string\">'J'<\/span>).count()\nSELECT COUNT(*) AS <span class=\"hljs-string\">\"__count\"<\/span>\n  FROM <span class=\"hljs-string\">\"hr_employee\"<\/span>\n WHERE <span class=\"hljs-string\">\"hr_employee\"<\/span>.<span class=\"hljs-string\">\"first_name\"<\/span>::text LIKE <span class=\"hljs-string\">'J%'<\/span>\nExecution time: <span class=\"hljs-number\">0.000000<\/span>s &#91;Database: default]\n<span class=\"hljs-number\">29<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this case, the <code>filter()<\/code> method forms a <code>WHERE<\/code> clause while the <code>count()<\/code> method forms the <code>COUNT()<\/code> function.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='max'>Max <a href=\"#max\" class=\"anchor\" id=\"max\" title=\"Anchor for Max\">#<\/a><\/h3>\n\n\n\n<p>The <code>Max()<\/code> returns the maximum value in a set of values. It accepts a column that you want to get the highest value. <\/p>\n\n\n\n<p>For example, the following uses the <code>Max()<\/code> to return the highest salary:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-meta\">&gt;&gt;&gt; <\/span>Employee.objects.aggregate(Max(<span class=\"hljs-string\">'salary'<\/span>))\nSELECT MAX(<span class=\"hljs-string\">\"hr_employee\"<\/span>.<span class=\"hljs-string\">\"salary\"<\/span>) AS <span class=\"hljs-string\">\"salary__max\"<\/span>\n  FROM <span class=\"hljs-string\">\"hr_employee\"<\/span>\nExecution time: <span class=\"hljs-number\">0.002001<\/span>s &#91;Database: default]\n{<span class=\"hljs-string\">'salary__max'<\/span>: Decimal(<span class=\"hljs-string\">'248312.00'<\/span>)}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>Max()<\/code> executes the SQL <code><a href=\"https:\/\/www.postgresqltutorial.com\/postgresql-aggregate-functions\/postgresql-max-function\/\" target=\"_blank\" rel=\"noreferrer noopener\">MAX()<\/a><\/code> on the salary column of the <code>hr_employee<\/code> table and returns the highest salary.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='min'>Min <a href=\"#min\" class=\"anchor\" id=\"min\" title=\"Anchor for Min\">#<\/a><\/h3>\n\n\n\n<p>The <code>Min()<\/code> returns the minimum value in a set of values. Like the <code>Max()<\/code>, it accepts a column that you want to get the lowest value.<\/p>\n\n\n\n<p>The following example uses the <code>Min()<\/code> to return the lowest salary of employees:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-meta\">&gt;&gt;&gt; <\/span>Employee.objects.aggregate(Min(<span class=\"hljs-string\">'salary'<\/span>)) \nSELECT MIN(<span class=\"hljs-string\">\"hr_employee\"<\/span>.<span class=\"hljs-string\">\"salary\"<\/span>) AS <span class=\"hljs-string\">\"salary__min\"<\/span>\n  FROM <span class=\"hljs-string\">\"hr_employee\"<\/span>\nExecution time: <span class=\"hljs-number\">0.002015<\/span>s &#91;Database: default]\n{<span class=\"hljs-string\">'salary__min'<\/span>: Decimal(<span class=\"hljs-string\">'40543.00'<\/span>)}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>Min()<\/code> function executes the SQL <code><a href=\"https:\/\/www.postgresqltutorial.com\/postgresql-aggregate-functions\/postgresql-min-function\/\" target=\"_blank\" rel=\"noreferrer noopener\">MIN()<\/a><\/code> function that returns the minimum value in the salary column.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='avg'>Avg <a href=\"#avg\" class=\"anchor\" id=\"avg\" title=\"Anchor for Avg\">#<\/a><\/h3>\n\n\n\n<p>The <code>Avg()<\/code> returns the average value in a set of values. It accepts a column name and returns the average value of all the values in that column:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-meta\">&gt;&gt;&gt; <\/span>Employee.objects.aggregate(Avg(<span class=\"hljs-string\">'salary'<\/span>)) \nSELECT AVG(<span class=\"hljs-string\">\"hr_employee\"<\/span>.<span class=\"hljs-string\">\"salary\"<\/span>) AS <span class=\"hljs-string\">\"salary__avg\"<\/span>\n  FROM <span class=\"hljs-string\">\"hr_employee\"<\/span>\nExecution time: <span class=\"hljs-number\">0.005468<\/span>s &#91;Database: default]\n{<span class=\"hljs-string\">'salary__avg'<\/span>: Decimal(<span class=\"hljs-string\">'137100.490909090909'<\/span>)}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Behind the scenes, the <code>Avg()<\/code> executes the SQL <code><a href=\"https:\/\/www.postgresqltutorial.com\/postgresql-aggregate-functions\/postgresql-avg-function\/\" target=\"_blank\" rel=\"noreferrer noopener\">AVG()<\/a><\/code> function on the salary column of the <code>hr_employee<\/code> and returns the average salary.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='sum'>Sum <a href=\"#sum\" class=\"anchor\" id=\"sum\" title=\"Anchor for Sum\">#<\/a><\/h2>\n\n\n\n<p>The <code><code>Sum()<\/code><\/code> returns the sum of values.  For example, you can use the <code><code>Sum()<\/code><\/code> to calculate the total salary of the company:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"Python\" data-shcb-language-slug=\"python\"><span><code class=\"hljs language-python\"><span class=\"hljs-meta\">&gt;&gt;&gt; <\/span>Employee.objects.aggregate(Sum(<span class=\"hljs-string\">'salary'<\/span>)) \nSELECT SUM(<span class=\"hljs-string\">\"hr_employee\"<\/span>.<span class=\"hljs-string\">\"salary\"<\/span>) AS <span class=\"hljs-string\">\"salary__sum\"<\/span>\n  FROM <span class=\"hljs-string\">\"hr_employee\"<\/span>\nExecution time: <span class=\"hljs-number\">0.000140<\/span>s &#91;Database: default]\n{<span class=\"hljs-string\">'salary__sum'<\/span>: Decimal(<span class=\"hljs-string\">'30162108.00'<\/span>)}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Python<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">python<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>Sum()<\/code> executes the SQL <code><a href=\"https:\/\/www.postgresqltutorial.com\/postgresql-aggregate-functions\/postgresql-sum-function\/\" target=\"_blank\" rel=\"noreferrer noopener\">SUM()<\/a><\/code> function and returns the total value of all the values in the salary column of the <code>hr_employee<\/code> table.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the <code>count()<\/code> method to get the number of objects of a <code>QuerySet<\/code>.<\/li>\n\n\n\n<li>Use the <code>Max()<\/code> to get the maximum value in a set of values.<\/li>\n\n\n\n<li>Use the <code>Min()<\/code> to get the minimum value in a set of values.<\/li>\n\n\n\n<li>Use the <code>Avg()<\/code> to get the average value in a set of values.<\/li>\n\n\n\n<li>Use the <code>Sum()<\/code> to get the total value of a set.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful ?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"6445\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/django-tutorial\/django-aggregate\/\"\n\t\t\t\tdata-post-title=\"Django Aggregate\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"6445\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/django-tutorial\/django-aggregate\/\"\n\t\t\t\tdata-post-title=\"Django Aggregate\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\t\t\t<input type=\"button\" name=\"wth-submit\" class=\"wth-btn wth-btn-submit\" id=\"wth-submit\" \/>\n\t\t\t<input type=\"button\" class=\"wth-btn wth-btn-cancel\" value=\"Cancel\" \/>\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you&#8217;ll learn how to use Django to get the aggregate values from the database including count, min, max, sum, and avg.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":5531,"menu_order":35,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-6445","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/6445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/comments?post=6445"}],"version-history":[{"count":0,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/6445\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/5531"}],"wp:attachment":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/media?parent=6445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}