A tax-information platform wants to identify each user's most-read tax articles during a recent reporting period. Write a SQL query that counts qualifying reads and ranks tax articles separately for each user.
Use September 15, 2026 as the reporting reference date. Include reads from the preceding 30 days through the end of September 15, 2026.
Output
- One row per user and qualifying tax article, with columns
user_id, user_name, article_id, article_title, read_count, and article_rank.
- Include only tax articles read by valid users during the specified 30-day period. Rows with a NULL article or user reference are excluded by the required matches.
- Return at most the three highest-ranked articles per user. Order by
user_id, then article_rank, then article_id; break equal-count ties by lower article_id.