CREATE PROCEDURE GetCustomerCount
AS
BEGIN
SELECT COUNT(*) AS CustomerCount FROM Customers;
END
CREATE PROCEDURE GetCustomersByCountry
@Country NVARCHAR(50)
AS
BEGIN
SELECT * FROM Customers WHERE Country = @Country;
END
CREATE PROCEDURE GetOrderDetails
@OrderID INT
AS
BEGIN
SELECT * FROM Orders WHERE OrderID = @OrderID;
END
CREATE PROCEDURE GetProductStats
@CategoryID INT
AS
BEGIN
SELECT COUNT(*) AS ProductCount, AVG(Price) AS AveragePrice
FROM Products
WHERE CategoryID = @CategoryID;
END
辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读: 如何监控post gresql状态