Query Design
Everything on SkillVeris tagged Query Design — collected across the glossary, study notes, blog, and cheat sheets.
8 resources across 1 library
Interview Questions(8)
Inner Join vs Outer Join
An INNER JOIN returns only the rows that have matching values in both tables, while an OUTER JOIN (LEFT, RIGHT, or FULL) returns matched rows plus unmatched ro…
ROW_NUMBER vs RANK vs DENSE_RANK: What is the Difference?
ROW_NUMBER assigns a unique, strictly increasing integer to every row with no ties, RANK assigns the same rank to tied rows but then skips the following rank n…
What Does PARTITION BY Do in SQL?
PARTITION BY divides the rows visible to a window function into independent groups, so the function's calculation restarts from scratch for each group instead…
What are LEAD and LAG Functions in SQL?
LAG and LEAD are offset window functions that let a row directly access a column's value from a preceding row (LAG) or a following row (LEAD) within the same o…
How Do You Calculate a Running Total with Window Functions?
A running total is calculated with SUM(column) OVER (ORDER BY sequence_column), which sums the target column across all rows from the start of the window up to…
What are the INTERSECT and EXCEPT Operators in SQL?
INTERSECT returns only the rows that appear in both of two SELECT result sets, while EXCEPT (also called MINUS in some databases) returns the rows from the fir…
What is a Self-Join and When Would You Use One?
A self-join is a regular join where a table is joined with itself, typically by giving the table two different aliases so rows can be compared against other ro…
What is a CROSS JOIN and When is it Useful?
A CROSS JOIN produces the Cartesian product of two tables, pairing every row from the first table with every row from the second table, with no join condition…