Sector file // sql
SQLDECODED.
Joins, indexes & queries
82 Questions56.3k Views3.4k Upvotes
15 easy51 med16 hard
Medium
4 questionsTop-N per group with RANK() OVER (PARTITION BY) โ how do you get top 2 per department without collapsing rows?
DSA ยท 1.2k views ยท window-functions, rank, partition
Views:1.2kLikes:74
What is the difference between ROW_NUMBER, RANK, and DENSE_RANK?
DSA ยท 740 views ยท window, ranking
Views:740Likes:7
How do you find the Nth highest salary?
DSA ยท 516 views ยท nth-highest
Views:516Likes:66
What are window functions?
DSA ยท 477 views ยท window-functions
Views:477Likes:78
Hard
4 questionsRANK() vs DENSE_RANK() vs ROW_NUMBER() โ when does the gap matter and how do you choose?
DSA ยท 1.1k views ยท window-functions, ranking, dense-rank
Views:1.1kLikes:48
How do you solve gaps-and-islands problems in SQL?
DSA ยท 511 views ยท window-functions, gaps-and-islands
Views:511Likes:5
pgvector cosine similarity index in 2025-26 โ HNSW vs IVFFlat for semantic search at scale?
System Design ยท 465 views ยท pgvector, hnsw, cosine-search
Views:465Likes:40
LATERAL vs Window Function vs Correlated Subquery for top-N per group โ which scales when?
System Design ยท 221 views ยท lateral-join, query-planning, performance
Views:221Likes:79
Seen a SQL question that is not here? Add it and help the next candidate.
Share a question