Sector file // sql
SQLDECODED.
Joins, indexes & queries
Easy
6 questionsWhat is the logical order of execution of a SQL query?
DSA · 1.1k views · order-of-execution
What is the CASE expression?
DSA · 1.0k views · case
What is the difference between WHERE and HAVING?
DSA · 1.0k views · where, having
What are the different types of SQL joins?
DSA · 985 views · sql, joins
What is a CROSS JOIN and when is it useful?
DSA · 484 views · joins
What is SQL injection and how do parameterized queries prevent it?
DSA · 374 views · security, injection
Medium
27 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
What is database normalization?
DSA · 1.2k views · normalization
Advanced UPSERT patterns — conditional updates, xmax detection, and soft-delete-aware indexes?
System Design · 1.2k views · upsert, idempotency, constraints
What is a subquery and what is a correlated subquery?
DSA · 1.2k views · subquery
LATERAL JOIN — how do you fetch the top 3 orders per customer efficiently?
DSA · 1.1k views · lateral-join, top-n, postgres
How does GROUP BY work with aggregate functions?
DSA · 1.1k views · group-by, aggregate
What are COMMIT, ROLLBACK, and SAVEPOINT?
DSA · 1.1k views · transactions
How do you aggregate values into a single string?
DSA · 1.1k views · string-agg
Hard
8 questionsJSONB vs normalized columns vs EAV — how do you model flexible attributes without killing query performance?
System Design · 1.1k views · jsonb, data-modeling, schema-design
RANK() 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
How do recursive CTEs work?
DSA · 1.1k views · recursive-cte
SKIP LOCKED for job queues — how do you build a concurrent queue without race conditions?
System Design · 857 views · skip-locked, queue, concurrency
How do you optimize a slow SQL query?
DSA · 816 views · query-optimization
How do you pivot rows into columns?
DSA · 651 views · pivot
How do you solve gaps-and-islands problems in SQL?
DSA · 511 views · window-functions, gaps-and-islands
What is table partitioning?
DSA · 44 views · partitioning
Seen a SQL question that is not here? Add it and help the next candidate.
Share a question