SQL Questions



1. When will ROW_NUMBER and RANK give different results? Give an example.
2. Is it possible for LEFT JOIN and FULL OUTER JOIN to produce the same results? Why or why not?
3. Why would I use DENSE_RANK instead of RANK? What about RANK instead of DENSE_RANK?
4. What happens if I GROUP BY a column that is not in the SELECT statement? Why does this happen?
5. LAG and LEAD are especially useful in what type of scenarios?
6. For dealing with NULL values, why would I choose to use IFNULL vs. CASE WHEN?
7. Do temp tables make your code cleaner and faster, one of the two, or none? Why?
8. When is a subquery a bad idea? A good idea?

Comments

Popular posts from this blog

Sequence

Stored Procedure