---
title: "cr_dp_views.sql"
url: "https://docs.yugabyte.com/stable/api/ysql/exprs/window_functions/analyzing-a-normal-distribution/cr-dp-views/"
---

# cr_dp_views.sql

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

Save this script as `cr_dp_views.sql`.

```plpgsql
create or replace view t4_view as
select
  k,
  dp_score as score
from t4;

-- This very simple view allows updates.
create or replace view results as
select method, bucket, n, min_s, max_s
from dp_results;
```
