PET task 4 finished

This commit is contained in:
Alex
2026-02-28 16:07:09 +03:00
parent de4a0fa2ec
commit cd4e5335aa
+2
View File
@@ -1,3 +1,4 @@
CREATE MATERIALIZED VIEW users_cohort_analysis AS
with needed_users as (
select distinct u.id as user_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,
avg_time_to_first_view
from CTE
;