ExcelR Assignment Solution for BA and Data Analytics. SQL #11 Subqueries and their applications
Автор: VIKAS EduClass
Загружено: 2025-11-25
Просмотров: 1086
ExcelR Assignment Solution for BA and Data Analytics. SQL #11 Subqueries and their applications
ExcelR Assignment Solution for BA and Data Analytics. SQL Assignment 10) b. LEAD and LAG
ExcelR Assignment Solution for BA and Data Analytics. SQL Assignment 10 Window functions - Rank, dense_rank, lead and lag
Year & Month Wise Orders + YoY % Change using Window Functions | SQL Tutorial for Beginners
OR (catchier)
SQL Window Functions Tutorial | Year-Month Order Count + YoY % | LEAD, LAG, SUM, GROUP BY
a) Using customers and orders tables, rank the customers based on their order frequency
b) Calculate year wise, month name wise count of orders and year over year (YoY) percentage change. Format the YoY values in no decimals and show in % sign.
Table: Orders
Expected output:
For SQL, Tableau, Excel and PowerBi Videos, watch my playlist and youtube channel link:
/ @vikaseduclass
Master SQL Window Functions with this practical and easy explanation!
In this video, we solve a real-time SQL question:
Q10. Using Customers and Orders tables, rank the customers based on their order frequency.
We also learn the difference between RANK, DENSE_RANK, LEAD, and LAG using a step-by-step demo.
Learn how to calculate Year-wise and Month-wise order count along with Year over Year (YoY) % change using SQL Window Functions.
This video is part of Q10 – Window Functions (Rank, Dense_Rank, Lead, Lag, etc.) and is perfect for students preparing for interviews, SQL assignments, data analyst jobs, BI roles, and SQL exams.
✅ In this video you will learn:
How to extract Year and Month Name from a date column
How to calculate Total Orders per Year & Month
How to calculate YoY % Change using LAG() window function
How to format YoY as percentage with no decimals
Use of GROUP BY, Order Aggregation, and Window Functions
Best practices for writing clean SQL Server queries
🎯 Topics Covered:
SQL Window Functions
LAG(), LEAD()
Group By Year and Month
YoY (Year over Year) Formula
Data Analytics SQL Problems
SQL Server (SSMS) Examples
📝 Sample Query Covered in Video:
SELECT
YEAR(orderDate) AS OrderYear,
DATENAME(MONTH, orderDate) AS MonthName,
COUNT(*) AS TotalOrders,
LAG(COUNT(*)) OVER (ORDER BY YEAR(orderDate), MONTH(orderDate)) AS PrevYearOrders,
FORMAT(
(COUNT(*) - LAG(COUNT(*)) OVER (ORDER BY YEAR(orderDate), MONTH(orderDate)))
100.0 / NULLIF(LAG(COUNT(*)) OVER (ORDER BY YEAR(orderDate), MONTH(orderDate)), 0),
'P0'
) AS YoY_Percentage
FROM Orders
GROUP BY YEAR(orderDate), MONTH(orderDate), DATENAME(MONTH, orderDate)
ORDER BY YEAR(orderDate), MONTH(orderDate);
💡 Who should watch this?
SQL Beginners
Data Analyst aspirants
Power BI / Excel / Tableau learners
BCA / MCA / B.Tech students
Anyone preparing for SQL Interviews
🔍 Topics Covered:
What are SQL Window Functions?
How RANK() works in SQL
How DENSE_RANK() is different from RANK()
Using LEAD and LAG for comparing previous and next values
Customer order frequency calculation
Real-time business use case: Ranking customers by number of orders
Complete SQL query explanation
#sql #sqltutorial #windowfunctions #sqlserver #ssms #dataanalytics #sqlinterview #leadlag #groupby #yoy #businessanalytics #learnsql #sqltraining #vikaseduclass
💡 Perfect for:
SQL beginners to advanced learners
Data analysts preparing for interviews
Students learning Window Functions
Anyone working with relational databases
Whether you’re learning MySQL, SQL Server, or PostgreSQL, this video will help you understand how SQL queries actually work — step-by-step!
👉 Don’t forget to LIKE, SUBSCRIBE, and SHARE for more SQL, Excel, Power BI, and Tableau tutorials.
📘 Channel: Vikas Educlass
#SQLTutorial #SQLForBeginners #LearnSQL #DatabaseTutorial #SQLPractice #MySQL #SQLServer #SQLQueries #vikaseduclass
VikasEduclass
🏷️ Tags (SEO Optimized)
sql tutorial, sql window functions, rank dense_rank lead lag, sql rank function, sql dense_rank function, sql lag lead tutorial, sql interview questions, sql for data analysts, mysql window functions, sql order frequency, customers and orders query, sql practice questions, sql analytics functions, sql group by with window functions, sql ranking functions tutorial
🔥 Hashtags (High Reach)
#SQL #WindowFunctions #Rank #DenseRank #Lead #Lag #SQLTutorial #DataAnalytics #SQLInterview #DatabaseQuery #MySQL #LearnSQL #SQLForBeginners #SQLPractice #techeducation
ExcelR Assignement
SQL ExcelR Assignment Solution
You will get all the solved ExcelR Assignment
Best Youtube Channel is Vikas EduClass
Vikas EduClass
Exceltips and Exceltricks by Vikas Educlass
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: