Author Archives: Stanislav_Panteleev

Database.Middle.How does database partitioning work?

Database partitioning is a technique used to split a large table into smaller, more manageable pieces, called partitions, while keeping them logically part of the same table. This improves performance, scalability, and sometimes maintenance. 🧠 Why Partition? ✅ Query performance: … Continue reading →

Posted in Без рубрики | Comments Off on Database.Middle.How does database partitioning work?

Database.Middle.What is a trigger? How and when would you use it?

A trigger in SQL is a database object that automatically executes (or “fires”) a specified block of code in response to certain events (like INSERT, UPDATE, or DELETE) on a table or view. 🔧 What Is a Trigger? A trigger … Continue reading →

Posted in Без рубрики | Comments Off on Database.Middle.What is a trigger? How and when would you use it?

Database.Middle.What is the difference between ROW_NUMBER(), RANK(), and DENSE_RANK()?

Great question! ROW_NUMBER(), RANK(), and DENSE_RANK() are ranking window functions in SQL that assign a number to each row based on some ordering criteria. They look similar but behave differently when there are ties in the data (i.e., rows with … Continue reading →

Posted in Без рубрики | Comments Off on Database.Middle.What is the difference between ROW_NUMBER(), RANK(), and DENSE_RANK()?

Database.Middle.What are CTEs (Common Table Expressions)?

CTEs (Common Table Expressions) are a way to write temporary, reusable result sets (like named subqueries) in SQL, using the WITH keyword. They’re especially useful for making complex queries more readable, modular, and recursive. 📌 Basic Syntax Think of a … Continue reading →

Posted in Без рубрики | Comments Off on Database.Middle.What are CTEs (Common Table Expressions)?

Database.Middle.If i don’t use ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, so i take all rows ?

Excellent question — and the answer depends on which window function you’re using, and whether you’re using ORDER BY in the OVER() clause. Let’s clarify it fully: ✅ If You Use ORDER BY Without ROWS BETWEEN When you write something … Continue reading →

Posted in Без рубрики | Comments Off on Database.Middle.If i don’t use ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW, so i take all rows ?

Database.Middle.WindowFunctions.Explain ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW

Great question! The clause: is used within a window function to define the range of rows (called the window frame) that the function operates on relative to the current row. 🔍 What It Means UNBOUNDED PRECEDING: Start from the first … Continue reading →

Posted in Без рубрики | Comments Off on Database.Middle.WindowFunctions.Explain ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW

Database.Total.Give examples with Sum(), Avg(), Max()

Let’s explore how to use window functions with SUM(), AVG(), and MAX() in SQL. These functions compute aggregates over a “window” of rows, but unlike GROUP BY, they don’t collapse rows — they return a result per row. 🎯 Sample … Continue reading →

Posted in Без рубрики | Comments Off on Database.Total.Give examples with Sum(), Avg(), Max()

Database.Middle.What is window function?

window functions (also called analytic functions) are a powerful feature in SQL that let you perform calculations across rows related to the current row, without collapsing them into a single result like GROUP BY does. 🧠 Simple Definition A window … Continue reading →

Posted in Без рубрики | Comments Off on Database.Middle.What is window function?

Database.Middle.Pagination.SeekMethod.What if some rows were deleted ?

Let’s say the last row returned has: Now for Page 2, we run: This query says: “Give me the next 10 rows older than what I already saw.” ❓What Happens If Rows Were Deleted? 🧼 If a previously returned row … Continue reading →

Posted in Без рубрики | Comments Off on Database.Middle.Pagination.SeekMethod.What if some rows were deleted ?

Database.Middle.Why, when we seek for pages no shifting from inserts/deletes on other rows ?

The Seek Method avoids “shifting” caused by inserts or deletes because it doesn’t depend on row positions like OFFSET does—it uses stable, deterministic values (like timestamps or IDs) to continue pagination. Let me explain it clearly: 🔁 The Problem with … Continue reading →

Posted in Без рубрики | Comments Off on Database.Middle.Why, when we seek for pages no shifting from inserts/deletes on other rows ?