Skip to main content
Practice

5

sql

SELECT user_id,
log_date,
course_name,
progress_percent,
LAG(progress_percent) OVER (PARTITION BY user_id ORDER BY log_date) AS previous_progress,
LEAD(progress_percent) OVER (PARTITION BY user_id ORDER BY log_date) AS next_progress
FROM course_progress;

Want to learn more?

Join CodeFriends Plus membership or enroll in a course to start your journey.