Skip to content

Releases: JustinFrizzell/wide-world-importers-sql-project

v1.2

12 Oct 22:38
b65e2eb
Compare
Choose a tag to compare

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

12 Oct 17:39
Compare
Choose a tag to compare

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

11 Oct 21:57
Compare
Choose a tag to compare

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 city
  • Challenges.TopSellingProductsByCity View of top 5 selling products split for each city
  • Challenges.StockItemSalesDistribution View showing the cumulative distribution of revenue by product
  • Challenges.ufn_GetTotalOrderWeight Function returning the total weight of a given OrderID