PET task 4 finished
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
CREATE MATERIALIZED VIEW users_cohort_analysis AS
|
||||||
with needed_users as (
|
with needed_users as (
|
||||||
select distinct u.id as user_id,
|
select distinct u.id as user_id,
|
||||||
u.registration_date as reg_date, e.course_id, lv.id as view_id,
|
u.registration_date as reg_date, e.course_id, lv.id as view_id,
|
||||||
@@ -24,3 +25,4 @@ ROUND(100.0 * active_users / users_in_cohort, 2) as retention_rate,
|
|||||||
courses_count::numeric / users_in_cohort as avg_courses_per_user,
|
courses_count::numeric / users_in_cohort as avg_courses_per_user,
|
||||||
avg_time_to_first_view
|
avg_time_to_first_view
|
||||||
from CTE
|
from CTE
|
||||||
|
;
|
||||||
Reference in New Issue
Block a user