---
title: "do_populate_results.sql"
url: "https://docs.yugabyte.com/stable/api/ysql/exprs/window_functions/analyzing-a-normal-distribution/do-populate-results/"
---

# do_populate_results.sql

do_populate_results.sql - Part of the code kit for the "Analyzing a normal distribution" section within the YSQL window functions documentation.

Save this script as `do_populate_results.sql`.

```plpgsql
do $body$
declare
  nof_buckets constant int not null := 20;
begin
  delete from results;
  call do_ntile        (nof_buckets);
  call do_percent_rank (nof_buckets);
  call do_cume_dist    (nof_buckets);
end;
$body$;
```
