SQL · Pinterest · Hard
You are given three relational tables — users, sessions, and orders — described by the schema below. Produce one SQL script built from CTEs and SELECT statements that uses joins and window functions; procedural loops and cursors are not permitted. The script must cover an analytics part in three sections (A, B, C) and must document, in comments, how the listed edge cases are handled (D). Schema: Sample data: Part A — 7-day rolling retention for each calendar day. For every…
Checking your access…