🚀
Q1. What are window functions?
A. Functions like ROW_NUMBER() OVER(...) that compute across a window without collapsing rows.
Advanced
🚀
Q2. How do isolation levels affect anomalies?
A. They control dirty/non-repeatable/phantom reads; stronger isolation reduces anomalies with more locking/overhead.
Advanced
🚀
Q3. What is a covering index?
A. An index that contains all columns needed by a query, avoiding table lookups.
Advanced
🚀
Q4. Clustered vs non-clustered index?
A. Clustered affects physical row order (engine-dependent). Non-clustered stores keys + pointers.
Advanced
🚀
Q5. When is an index not used?
A. Low selectivity, function on indexed column, leading wildcard LIKE "%x", or optimizer choice.
Advanced
🚀
Q6. What is cardinality?
A. Estimated number of rows; impacts plan selection. Bad stats can cause slow plans.
Advanced
🚀
Q7. What is partitioning?
A. Splitting a table into parts (range/hash/list) to improve manageability and performance.
Advanced
🚀
Q8. How do you prevent deadlocks?
A. Keep transactions short, access rows in consistent order, use proper indexes, and retry on deadlock.
Advanced