What does NULL represent in a database?
Unknown or missing data
Is NULL equal to 0 or empty string?
No
Which keyword is used to check NULL values?
IS NULL / IS NOT NULL
Do aggregate functions include NULL values?
No, they ignore NULL
COALESCE return?
The first non-NULL value
What happens when you compare NULL with any value?
Result is NULL (unknown)
What is the purpose of COALESCE in queries?
To replace NULL with default value
What does the CASE expression do?
Adds if-then-else logic in SQL
In CASE, which condition is applied if multiple are true?
The first matching condition
What is a CTE (Common Table Expression)?
A temporary result set used in a query
Why are CTEs useful? Name one reason.
Readability / Reusability / Debugging
What keyword defines a CTE?
WITH
bonus
+500
You can steal 300 points from the other team.
300
Difference between GROUP BY and window functions?
GROUP BY collapses rows, window functions keep them
bomb
-400
What happens to numbering in ROW_NUMBER() with PARTITION BY?
It restarts for each partition
Difference between RANK() and DENSE_RANK()?
RANK skips numbers, DENSE_RANK does not
What does LAG() function do?
Gets value from previous row
What does LEAD() function do?
Gets value from next row
What is conditional aggregation?
Using CASE inside aggregate functions
Why is ORDER BY important in LAG/LEAD?
It defines row order
What happens if OVER() is empty?
Applies to entire result set
Can multiple CTEs be used in one query?
Yes, separated by commas
Why are window functions powerful?
They analyze data without losing individual rows