ExcelR Assignment Solution for BA and Data Analytics. Assignment 9 in SQL | Stored Procedure
Автор: VIKAS EduClass
Загружено: 2025-11-16
Просмотров: 1109
ExcelR Assignment Solution for BA and Data Analytics. Assignment 9 in SQL | Stored Procedures in SQL with parameters.
SQL Stored Procedure with Parameters | Year-wise & Country-wise Payments | Format Amount in K | SQL Tutorial
In this video, you will learn how to create a Stored Procedure in SQL that accepts parameters (Year & Country) and returns total payments grouped year-wise and country-wise.
We will use the Customers and Payments tables to generate a clean, formatted result where the payment amount is shown in thousands (K).
👉 What you will learn in this video:
How to create a stored procedure with input parameters
How to join Customers and Payments tables
How to filter data using YEAR() function
How to group results by year and country
How to format numeric values into thousands (K format)
How to call/execute the stored procedure
Perfect example for interviews, SQL exams, and projects
📌 Stored Procedure Used in Video:
DELIMITER //
CREATE PROCEDURE Get_country_payments(IN p_year INT, IN p_country VARCHAR(50))
BEGIN
SELECT
YEAR(p.paymentDate) AS PaymentYear,
c.country AS Country,
CONCAT(ROUND(SUM(p.amount)/1000, 1), 'K') AS TotalAmountK
FROM customers c
JOIN payments p
ON c.customerNumber = p.customerNumber
WHERE YEAR(p.paymentDate) = p_year
AND c.country = p_country
GROUP BY PaymentYear, Country;
END //
DELIMITER ;
📌 Call Procedure:
CALL Get_country_payments(2023, 'USA');
If you found this video helpful, don’t forget to Like, Share & Subscribe for more SQL, Excel, Power BI, and data analytics content.
🔥 Best Hashtags for Maximum Reach
#SQL #StoredProcedure #SQLTutorial #MySQL #SQLQueries #LearnSQL #SQLInterviewQuestions #DataAnalytics #YearWiseReport #CountryWiseReport #PaymentReport #vikaseduclass #excelr
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
-
Информация по загрузке: