---
title: "Discussion on \"SQL Detective Mode: Using DENSE_RANK to Identify Top Earners by Department\" | Hashnode"
description: "Discussion on \"SQL Detective Mode: Using DENSE_RANK to Identify Top Earners by Department\". #185: Department Top Three Salaries — A LeetCode challenge solved with window functions and clean CTE logic."
url: "https://hashnode.com/posts/sql-detective-mode-using-denserank-to-identify-top-earners-by-department/68aea6380ec63ecd0e8291ba"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [SQL Detective Mode: Using DENSE\_RANK to Identify Top Earners by Department](https://advance-sql.hashnode.dev/sql-detective-mode-using-denserank-to-identify-top-earners-by-department?utm_source=hashnode&utm_medium=feed)

#185: Department Top Three Salaries — A LeetCode challenge solved with window functions and clean CTE logic.

Aug 27, 2025 · 2 min read · advance-sql.hashnode.dev  
Read the article

-   [#sql](https://hashnode.com/tag/sql)
-   [#data-science](https://hashnode.com/tag/data-science)
-   [#data-structures](https://hashnode.com/tag/data-structures)
-   [#databases](https://hashnode.com/tag/databases)
-   [#leetcode](https://hashnode.com/tag/leetcode)

## Written by

[Ardhendu Ghosh](https://hashnode.com/@ardhendughosh)

@ardhendughosh · India

  
[View profile](https://hashnode.com/@ardhendughosh)

DYNAMIC

🧵 Stitching logic into data, culture into pixels, and clarity into workflows. I’m Ardhendu Ghosh—a systems architect in the making, blending SQL precision, annotation logic, and creative restoration into scalable, story-driven solutions. I build: 🧠 Reusable query modules for streaks, duplicates &amp; classification 🎨 Emotionally attentive image enhancements (yes, even bindis matter) 📊 Dashboard-ready logic for annotation pipelines &amp; public sharing ✍️ SEO-optimized content for Hashnode, LinkedIn &amp; beyond If it’s repeatable, teachable, and culturally meaningful—I’m building it.

## Responses 1

Markdown supported · ⌘↵ to post

[Aet](https://hashnode.com/@dfree)

[Aug 27, 2025](https://hashnode.com/posts/sql-detective-mode-using-denserank-to-identify-top-earners-by-department/68aea6380ec63ecd0e8291ba/comment/68aed05389e4b4e3ff428041)

nice...................
