Releases: JustinFrizzell/wide-world-importers-sql-project
Releases · JustinFrizzell/wide-world-importers-sql-project
v1.2
v1.2 contains a new stored procedure:
- Challenges.usp_PurgeCustomerData - A stored procedure to remove customer data from the database after a GDPR request
Example usage:
-- Removes all customer data for customer with CustomerID = 1
EXEC Challenges.usp_PurgeCustomerData @CustomerID = 1;
v1.1
v1.1 contains an additional user defined function:
- When provided an invoice ID,
Challenges.ufn_DaysSinceLastInvoice
returns the number of days since the last invoice for that same customer.
Example usage:
SELECT
i.InvoiceID
, i.CustomerID
, l.PreviousInvoiceDate
, l.CurrentInvoiceDate
, l.DaysSinceLastInvoice
FROM
Sales.Invoices AS i
CROSS APPLY
dbo.ufn_DaysSinceLastInvoice(i.InvoiceID) AS l
WHERE
i.CustomerID = 847;
v1.0
Initial release.
Contains the WideWorldImporters database project including three new views and a user defined function:
Challenges.MonthlySalesSummary
View of monthly sales figures split by cityChallenges.TopSellingProductsByCity
View of top 5 selling products split for each cityChallenges.StockItemSalesDistribution
View showing the cumulative distribution of revenue by productChallenges.ufn_GetTotalOrderWeight
Function returning the total weight of a given OrderID