SQL Challenge Compare Today's Sales With Yesterday's Sales Using LAG() in Oracle SQLWhen working with sales data, looking at daily revenue alone doesn't always tell the complete story. Sometimes, businesses need to compare today's sales with the previous day's sales to understand w4 min read·sankalandtech.hashnode.dev6h ago
SQL Running Total Using SUM() OVER() in Oracle SQL – Practical ExampleWhen working with sales data, sometimes we need more than just the total sales for a particular day. For example, imagine your manager asks you to prepare a report showing daily sales along with the t3 min read·sankalandtech.hashnode.dev1d ago
SQL Challenge : Find the Second Purchase of Every Customer Using ROW_NUMBER()In real-world applications, businesses often need to track customer purchase history. One common requirement is finding the second order placed by each customer. This information can help businesses3 min read·sankalandtech.hashnode.dev2d ago
SQL Challenge #103: Find the Top 2 Highest-Paid Employees in Every Department Using ROW_NUMBER()Window functions are very useful in SQL interviews and real-world data analysis. They help us rank records, compare values and solve problems that are difficult to handle with basic aggregate function4 min read·sankalandtech.hashnode.dev3d ago
SQL Challenge : ROW_NUMBER() vs RANK() vs DENSE_RANK() – What's the Difference?SQL window functions are useful when working with employee rankings, sales reports and business data. Three commonly used ranking functions are "ROW_NUMBER()", "RANK()" and "DENSE_RANK()". Although th2 min read·sankalandtech.hashnode.dev4d ago